ESCOMP / ESCOMP/atmospheric_physics

Improve use of CCPP I/O reader in gravity wave drag schemes

Open
#321 0 comments 0 reactions 0 assignees View on GitHub
cleanup
Dominant language
Fortran
Stars
12
Forks
38
Avg merge
11h 16m
Merged PRs (30d)
5

Description

From review of GW https://github.com/ESCOMP/atmospheric_physics/pull/292

For moving mountain
```fortran
! Allocate mfcc. "desc%maxh" and "desc%maxuh" are from the file, but the
! model determines wavenumber dimension.
allocate (desc%mfcc(desc%maxh, -desc%maxuh:desc%maxuh, &
-band%ngwv:band%ngwv), stat=errflg, errmsg=errmsg)
if(errflg /= 0) then
return
endif

! Get mfcc data.
call reader%get_var('NEWMF', file_mfcc, errmsg, errflg)
if (errflg /= 0) then
return
end if

! original formulation is
! desc%mfcc(:,-desc%maxuh:desc%maxuh,-band%ngwv:band%ngwv) = file_mfcc(:,:,ngwv_file-band%ngwv+1:)
! where band%ngwv = 0 -- this cannot be handled directly by the
! ccpp i/o reader, so copy it in from the temporary array.
desc%mfcc(:, -desc%maxuh:desc%maxuh, 0) = file_mfcc(:, :)
```
@nusbaume wrote:
> It might be good to eventually figure out what exactly can't be handled by the pio_reader here (maybe worth including in the "future work" issue?).

For Beres/convective:
```fortran
call reader%get_var('MW', tmp_var1d, errmsg, errflg)
if (errflg /= 0) then
return
end if
desc%maxuh = size(tmp_var1d)
deallocate(tmp_var1d, stat=errflg)
```
@nusbaume wrote:
> It would be good to replace this and the code below with a get_dim method at some point. Maybe worth adding to the "future work" issue?

@peverwhee wrote:
> can we get these from the file instead of hard-coding them? Maybe this is part of https://github.com/ESCOMP/atmospheric_physics/issues/321 ?

for the moving mountain initialization code as well.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.