Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code changes related to EMC FMS mixedmode #163

Merged
merged 20 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
164097c
Update code to use 'constantsR4_mod' module (#59)
binli2337 Oct 21, 2021
122c2c5
Fix OVERLOAD_R4 ifdef block as suggested by @junwang-noaa (#60)
MinsukJi-NOAA Oct 28, 2021
18586e7
Update fms_mixedmode to gfdl_atmos_cubed_sphere/dev/emc (#61)
MinsukJi-NOAA Nov 10, 2021
4aec45d
Merge remote-tracking branch 'gfdl/dev/emc' into fms_mixedmode
MinsukJi-NOAA Nov 10, 2021
80d7c52
update external_ic.F90 and fv_nudge.F90 (#63)
binli2337 Nov 19, 2021
9e06d9d
Update external_ic.F90 and fv_nudge.F90 to use allocatable arrays (#65)
binli2337 Dec 8, 2021
83385da
Update NOAA-EMC fms_mixedmode branch to GFDL dev/emc branch(#67)
MinsukJi-NOAA Feb 1, 2022
2f88d44
revise external_ic.F90 and fv_nudge.F90 (#68)
binli2337 Feb 4, 2022
c0d57b9
Update to the latest noaa-gfdl dev/emc branch (#69)
MinsukJi-NOAA Mar 2, 2022
19792ad
Update to the latest GFDL dev/emc (#70)
MinsukJi-NOAA Mar 30, 2022
8131f2b
Resolve conflicts with the latest GFDL dev/emc (#71)
MinsukJi-NOAA Jun 14, 2022
9d4843f
Update fv_nggps_diag.F90
MinsukJi-NOAA Jun 14, 2022
26fadd1
Update fms_mixedmode branch of NOAA-EMC/GFDL_atmos_cubed_sphere (#73)
binli2337 Jun 30, 2022
dcff74d
Fms mixed mode (#74)
binli2337 Aug 2, 2022
aef9558
Merge remote-tracking branch 'upstream/dev/emc' into fms_mixedmode
binli2337 Oct 20, 2022
0ab12b6
Update fms_mixedmode branch (#76)
binli2337 Oct 21, 2022
a9ea891
Revert "Update fms_mixedmode branch (#76)" (#77)
junwang-noaa Oct 24, 2022
780650a
Merge pull request #79 from binli2337/update_dev_emc20221017
junwang-noaa Nov 3, 2022
5e1d9cd
Merge branch 'dev/emc' into test/update_fms
binli2337 Dec 7, 2022
8c6a048
Merge pull request #81 from binli2337/test/update_fms
junwang-noaa Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions tools/external_ic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -4173,16 +4173,17 @@ subroutine pmaxmin( qname, a, im, jm, fac )
integer i, j
class(*) a(im,jm)

real(r4_kind) qmin(jm), qmax(jm)
real(r4_kind) pmax, pmin
real(r4_kind), dimension(:), allocatable :: qmin, qmax
real(r4_kind) pmax, pmin
class(*) fac ! multiplication factor
real(r8_kind) qmin8(jm), qmax8(jm)
real(r8_kind) pmax8, pmin8
real(r8_kind), dimension(:), allocatable :: qmin8, qmax8
real(r8_kind) pmax8, pmin8

select type (fac)
type is (real(kind=r4_kind))
select type (a)
type is (real(kind=r4_kind))
allocate(qmax(jm), qmin(jm))
do j=1,jm
pmax = a(1,j)
pmin = a(1,j)
Expand All @@ -4202,6 +4203,7 @@ subroutine pmaxmin( qname, a, im, jm, fac )
pmax = max(pmax, qmax(j))
pmin = min(pmin, qmin(j))
enddo
deallocate(qmax, qmin)

write(*,*) qname, ' max = ', pmax*fac, ' min = ', pmin*fac
class default
Expand All @@ -4211,6 +4213,7 @@ subroutine pmaxmin( qname, a, im, jm, fac )
type is (real(kind=r8_kind))
select type (a)
type is (real(kind=r8_kind))
allocate(qmax8(jm), qmin8(jm))
do j=1,jm
pmax8 = a(1,j)
pmin8 = a(1,j)
Expand All @@ -4230,6 +4233,7 @@ subroutine pmaxmin( qname, a, im, jm, fac )
pmax8 = max(pmax8, qmax8(j))
pmin8 = min(pmin8, qmin8(j))
enddo
deallocate(qmax8, qmin8)

write(*,*) qname, ' max = ', pmax8*fac, ' min = ', pmin8*fac
class default
Expand Down
6 changes: 5 additions & 1 deletion tools/fv_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ module fv_diagnostics_mod
use time_manager_mod, only: time_type, get_date, get_time
use mpp_domains_mod, only: domain2d, mpp_update_domains, DGRID_NE, NORTH, EAST
use diag_manager_mod, only: diag_axis_init, register_diag_field, &
register_static_field, send_data, diag_grid_init
register_static_field, send_data, diag_grid_init, &
diag_field_add_attribute
use fv_arrays_mod, only: fv_atmos_type, fv_grid_type, fv_diag_type, fv_grid_bounds_type, &
R_GRID
use fv_mapz_mod, only: E_Flux, moist_cv, moist_cp, mappm
Expand Down Expand Up @@ -539,6 +540,9 @@ subroutine fv_diag_init(Atm, axes, Time, npx, npy, npz, p_ref)
'latitude', 'degrees_N' )
id_area = register_static_field ( trim(field), 'area', axes(1:2), &
'cell area', 'm**2' )
if (id_area > 0) then
call diag_field_add_attribute (id_area, 'cell_methods', 'area: sum')
endif
id_dx = register_static_field( trim(field), 'dx', (/id_xt,id_y/), &
'dx', 'm')
id_dy = register_static_field( trim(field), 'dy', (/id_x,id_yt/), &
Expand Down
8 changes: 6 additions & 2 deletions tools/fv_nudge.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3545,16 +3545,17 @@ subroutine pmaxmin( qname, a, imax, jmax, fac )
class(*) a(imax,jmax)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "class(*)"? Is this new Fortran functionality, and if so what version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is F2003. These changes are part of the efforts to allow FMS to handle both 32- and 64-bit interfaces.

class(*) fac ! multiplication factor

real(r4_kind) qmin(jmax), qmax(jmax)
real(r4_kind), dimension(:), allocatable :: qmin, qmax
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these need to be allocatable arrays when we already know their length?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allocatable is used to save memory: Depending on whether it is dealing with single or double data (from FMS), either (qmin, qmax) OR (qmin8, qmax8) is required, but not both; the selection and allocation is done inside the select type construct below.

real(r4_kind) pmax, pmin

real(r8_kind) qmin8(jmax), qmax8(jmax)
real(r8_kind), dimension(:), allocatable :: qmin8, qmax8
real(r8_kind) pmax8, pmin8

select type (fac)
type is (real(kind=r4_kind))
select type (a)
type is (real(kind=r4_kind))
allocate(qmax(jmax), qmin(jmax))
do j=1,jmax
pmax = a(1,j)
pmin = a(1,j)
Expand All @@ -3574,6 +3575,7 @@ subroutine pmaxmin( qname, a, imax, jmax, fac )
pmax = max(pmax, qmax(j))
pmin = min(pmin, qmin(j))
enddo
deallocate(qmax, qmin)

write(*,*) qname, ' max = ', pmax*fac, ' min = ', pmin*fac
class default
Expand All @@ -3583,6 +3585,7 @@ subroutine pmaxmin( qname, a, imax, jmax, fac )
type is (real(kind=r8_kind))
select type (a)
type is (real(kind=r8_kind))
allocate(qmax8(jmax), qmin8(jmax))
do j=1,jmax
pmax8 = a(1,j)
pmin8 = a(1,j)
Expand All @@ -3602,6 +3605,7 @@ subroutine pmaxmin( qname, a, imax, jmax, fac )
pmax8 = max(pmax8, qmax8(j))
pmin8 = min(pmin8, qmin8(j))
enddo
deallocate(qmax8, qmin8)

write(*,*) qname, ' max = ', pmax8*fac, ' min = ', pmin8*fac
class default
Expand Down