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

cam6_3_086: Introduce PUMAS DDT #632

Merged
merged 43 commits into from
Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d9d3327
rough prototype for DDT
cacraigucar May 11, 2022
82df5e6
Remove MG1 and prototype DDT with a couple of fields
cacraigucar Jul 7, 2022
9872156
First major chunk of variables in ddt
cacraigucar Jul 18, 2022
8a8e52a
Second chunk of variables in ddt
cacraigucar Jul 29, 2022
6666fb6
Completed initial list for DDT
cacraigucar Aug 2, 2022
5e86e64
Added comment to clarify hole filling pbuf fields
cacraigucar Aug 3, 2022
c2aac05
Minor cleanup
cacraigucar Aug 3, 2022
25a9e2e
Remove commit of cam/micro_pumas_cam.F90 which should not have been made
cacraigucar Aug 3, 2022
1cdc45b
Update external to temporary PUMAS hash
cacraigucar Aug 3, 2022
1753457
Fix dimension for addfld for UMR and UMS
cacraigucar Aug 8, 2022
2600ac2
Merge to cam6_3_072
cacraigucar Aug 19, 2022
d6244ac
Add addtional fields to PUMAS DDT
cacraigucar Sep 1, 2022
117d3d5
Update temporary PUMAS hash
cacraigucar Sep 1, 2022
ef4157c
Test using ncol instead of psetcols for DDT allocation
cacraigucar Sep 12, 2022
4e7ddf9
Mods for using ncol dimension and WACCM bug fixes
cacraigucar Sep 23, 2022
5dc0963
Add interface for collecting history dimension values
Sep 28, 2022
dd03ed1
Merge pull request #14 from gold2718/foo
cacraigucar Sep 29, 2022
b527a7c
Zero out more fields and add writing of trop_cld_lev values to file
cacraigucar Oct 3, 2022
66abb39
Merge tag 'cam6_3_078' into cam6_pumas_ddt
cacraigucar Oct 6, 2022
0f066d4
Update hash for pumas
cacraigucar Oct 10, 2022
bb598ba
Bring in official PUMAS tag
cacraigucar Oct 11, 2022
6e4eab3
Address reviewer's comments
cacraigucar Nov 10, 2022
3c9ddd0
Merge tag 'cam6_3_082' into cam6_pumas_ddt
cacraigucar Nov 16, 2022
da54627
Merge tag 'cam6_3_083' into cam6_pumas_ddt
cacraigucar Nov 16, 2022
d00fcb9
Use handle_allocate_error in micro_pumas_cam
cacraigucar Nov 17, 2022
5c18715
Fixes initialization for cam_dev
cacraigucar Nov 21, 2022
735f5dd
Initialize pbuf indices
cacraigucar Nov 21, 2022
4664a99
update python paths, only build ali_arms with waccm
jedwards4b Nov 28, 2022
3673525
reduce the number of times orb_param is printed to log
jedwards4b Nov 28, 2022
f6c7ca8
Address reviewer's comments
cacraigucar Nov 30, 2022
8f670f9
Merge remote-tracking branch 'origin/cam_fix_init_cam_dev' into cam6_…
cacraigucar Nov 30, 2022
e701690
Merge remote-tracking branch 'jim/config_changes' into cam6_pumas_ddt
cacraigucar Nov 30, 2022
b243853
Merge remote-tracking branch 'jim/orb_params_print_issue' into cam6_p…
cacraigucar Nov 30, 2022
30dded9
Reduce number of PEs for CONUS regression tests
cacraigucar Dec 1, 2022
ceb57eb
add a couple of parameters
cacraigucar Dec 1, 2022
0a03410
Merge tag 'cam6_3_085' into cam6_pumas_ddt
cacraigucar Dec 1, 2022
8407498
Initializing variables to avoid startup interpolation error in cam_dev.
bstephens82 Dec 3, 2022
6358b7d
Merge pull request #15 from bstephens82/cam_fix_init_cam_dev
cacraigucar Dec 5, 2022
8431a93
Merge remote-tracking branch 'origin/cam_fix_init_cam_dev' into cam6_…
cacraigucar Dec 5, 2022
960b294
Update cime to fix create_newcase
cacraigucar Dec 5, 2022
259ac9a
Update mosart external to work with updated cime and address final re…
cacraigucar Dec 7, 2022
bed1694
Fix allocation problem
cacraigucar Dec 8, 2022
ee94a75
Add ChangeLog for cam6_3_086
cacraigucar Dec 8, 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
4 changes: 2 additions & 2 deletions Externals.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ local_path = libraries/parallelio
required = True

[cime]
tag = cime6.0.64
tag = cime6.0.76
protocol = git
repo_url = https://github.com/ESMCI/cime
local_path = cime
Expand Down Expand Up @@ -96,7 +96,7 @@ externals = Externals_FMS.cfg
required = True

[mosart]
tag = mosart1_0_45
tag = mosart1_0_47
protocol = git
repo_url = https://github.com/ESCOMP/MOSART
local_path = components/mosart
Expand Down
2 changes: 1 addition & 1 deletion Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ required = True
local_path = src/physics/pumas
protocol = git
repo_url = https://github.com/ESCOMP/PUMAS
tag = pumas_cam-release_v1.27
tag = pumas_cam-release_v1.28
required = True

[pumas-frozen]
Expand Down
9 changes: 4 additions & 5 deletions bld/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ elsif ($fc =~ /nvfor/) { $fc_type = 'nvhpc'; }

# User override for Fortran compiler type
if (defined $opts{'fc_type'}) { $fc_type = $opts{'fc_type'}; }

if ($fc_type == "oneapi") {$fc_type = 'intel'; }
if ($fc_type) {
$cfg_ref->set('fc_type', $fc_type);
if ($print>=2) { print "Fortran compiler type: $fc_type$eol"; }
Expand Down Expand Up @@ -2150,6 +2150,9 @@ sub write_filepath
}
if ($waccm_phys) {
print $fh "$camsrcdir/src/physics/waccm\n";
print $fh "$camsrcdir/src/physics/ali_arms\n";
print $fh "$camsrcdir/src/physics/ali_arms/subs\n";
print $fh "$camsrcdir/src/physics/ali_arms/include\n";
}
print $fh "$camsrcdir/src/ionosphere\n";

Expand Down Expand Up @@ -2178,10 +2181,6 @@ sub write_filepath
print $fh "$camsrcdir/src/physics/pumas-frozen\n";
}

print $fh "$camsrcdir/src/physics/ali_arms\n";
print $fh "$camsrcdir/src/physics/ali_arms/subs\n";
print $fh "$camsrcdir/src/physics/ali_arms/include\n";

# Superparameterization
if ($phys_pkg eq 'spcam_m2005' or $phys_pkg eq 'spcam_sam1mom') {
print $fh "$camsrcdir/src/physics/spcam\n";
Expand Down
2 changes: 1 addition & 1 deletion cime_config/buildcpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import os, sys, re
CIMEROOT = os.environ.get("CIMEROOT")
if CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")
sys.path.append(os.path.join(CIMEROOT, "scripts", "Tools"))
sys.path.append(os.path.join(CIMEROOT, "CIME", "Tools"))

from standard_script_setup import *

Expand Down
4 changes: 2 additions & 2 deletions cime_config/buildlib
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _CIMEROOT = os.environ.get("CIMEROOT")
if _CIMEROOT is None:
raise SystemExit("ERROR: must set CIMEROOT environment variable")

_LIBDIR = os.path.join(_CIMEROOT, "scripts", "Tools")
_LIBDIR = os.path.join(_CIMEROOT, "CIME", "Tools")
sys.path.append(_LIBDIR)

from standard_script_setup import *
Expand Down Expand Up @@ -99,7 +99,7 @@ def _build_cam(caseroot, libroot, bldroot):
complib = os.path.join(libroot, "libatm.a")
makefile = os.path.join(casetools, "Makefile")

cmd = "{} complib -j {} MODEL=cam COMPLIB={} -f {} {} " \
cmd = "{} complib -j {} COMP_NAME=cam COMPLIB={} -f {} {} " \
.format(gmake, gmake_j, complib, makefile, get_standard_makefile_args(case))
if cam_cppdefs:
cmd += " USER_CPPDEFS='{}'".format(cam_cppdefs)
Expand Down
6 changes: 4 additions & 2 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1516,13 +1516,14 @@
<option name="wallclock">00:20:00</option>
</options>
</test>
<test compset="FCnudged" grid="ne0CONUSne30x8_ne0CONUSne30x8_mt12" name="SMS_D_Ln9_Vnuopc" testmods="cam/outfrq9s_refined_camchem">
<test compset="FCnudged" grid="ne0CONUSne30x8_ne0CONUSne30x8_mt12" name="SMS_D_Ln9_Vnuopc_P720x1" testmods="cam/outfrq9s">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a new <option name="comment" > entry for this test that describes in words what this is testing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@nusbaume - I just changed the processor count and changed the testmods as @fvitt suggested in #708. I do not know what this is testing exactly as I did not introduce the test. I would suggest that test descriptions be added when the testing list is updated?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@fvitt can you provide a short one sentence description of what model configuration this is testing?

@cacraigucar Although I imagine we will certainly try to add in test descriptions when we do the test list update, adding descriptions in when we can beforehand will make that (big) job a little easier, and will save us from pinging Francis and other people a bunch of times when that development is ongoing.

Copy link

Choose a reason for hiding this comment

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

Nudged CAM-Chem on a regionally refined grid

<machines>
<machine name="cheyenne" compiler="intel" category="prealpha"/>
<machine name="cheyenne" compiler="intel" category="camchem"/>
</machines>
<options>
<option name="wallclock">00:20:00</option>
<option name="comment">"Nudged CAM-Chem on a regionally refined grid"</option>
</options>
</test>
<test compset="FCts2nudged" grid="f09_f09_mg17" name="SMS_D_Ln9_Vnuopc" testmods="cam/outfrq9s_leapday">
Expand Down Expand Up @@ -1622,13 +1623,14 @@
<machine name="cheyenne" compiler="intel" category="camchem"/>
</machines>
</test>
<test compset="FCHIST" grid="ne0CONUSne30x8_ne0CONUSne30x8_mt12" name="SMS_D_Ln9_Vnuopc" testmods="cam/outfrq9s_refined_camchem">
<test compset="FCHIST" grid="ne0CONUSne30x8_ne0CONUSne30x8_mt12" name="SMS_D_Ln9_Vnuopc_P720x1" testmods="cam/outfrq9s">
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a new <option name="comment" > entry for this test that describes in words what this is testing?

Copy link

Choose a reason for hiding this comment

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

Free running CAM-Chem on a regionally refined grid

<machines>
<machine name="cheyenne" compiler="intel" category="aux_cam"/>
<machine name="cheyenne" compiler="intel" category="camchem"/>
</machines>
<options>
<option name="wallclock">00:30:00</option>
<option name="comment">"Free running CAM-Chem on a reginally refined grid"</option>
</options>
</test>
<test compset="FCHIST" grid="ne0CONUSne30x8_ne0CONUSne30x8_mt12" name="ERS_Ld3_Vnuopc" testmods="cam/outfrq1d_refined_camchem">
Expand Down
140 changes: 138 additions & 2 deletions src/control/cam_history_support.F90
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ module cam_history_support
public :: lookup_hist_coord_indices, hist_coord_find_levels
public :: get_hist_coord_index, hist_coord_name, hist_coord_size
public :: hist_dimension_name
public :: hist_dimension_values

interface add_hist_coord
module procedure add_hist_coord_regonly
Expand All @@ -318,7 +319,12 @@ module cam_history_support
interface hist_coord_size
module procedure hist_coord_size_char
module procedure hist_coord_size_int
end interface
end interface hist_coord_size

interface hist_dimension_values
module procedure hist_dimension_values_r8
module procedure hist_dimension_values_int
end interface hist_dimension_values

interface assignment(=)
module procedure field_copy
Expand Down Expand Up @@ -1938,7 +1944,7 @@ end function hist_coord_find_levels

!#######################################################################

character(len=max_hcoordname_len) function hist_dimension_name (size)
character(len=max_hcoordname_len) function hist_dimension_name(size)
! Given a specific size value, return the first registered dimension name which matches the size, if it exists
! Otherwise the name returned is blank

Expand All @@ -1959,4 +1965,134 @@ end function hist_dimension_name

!#######################################################################

subroutine hist_dimension_values_r8(name, rvalues, istart, istop, found)
! Given the name of a dimension, return its (real) values in <rvalues>
! If <istart> and <istop> are present, they are the beginning and ending
! indices of the dimension values to return in <rvalues>. By default,
! the entire array is copied.
! If <found> is passed, return .true. if <name> is a defined dimension
! with real values.

! Dummy arguments
character(len=*), intent(in) :: name
real(r8), intent(out) :: rvalues(:)
integer, optional, intent(in) :: istart
integer, optional, intent(in) :: istop
logical, optional, intent(out) :: found
! Local variables
integer :: indx, jndx, rndx
integer :: ibeg
integer :: iend
logical :: dim_ok
real(r8), parameter :: unset_r8 = huge(1.0_r8)
character(len=*), parameter :: subname = ': hist_dimension_values_r8'

dim_ok = .false.
peverwhee marked this conversation as resolved.
Show resolved Hide resolved
rvalues(:) = unset_r8

do indx = 1, registeredmdims
if(trim(name) == trim(hist_coords(indx)%name)) then
dim_ok = associated(hist_coords(indx)%real_values)
if (dim_ok) then
if (present(istart)) then
ibeg = istart
if (ibeg < LBOUND(hist_coords(indx)%real_values, 1)) then
call endrun(subname//": istart is outside the bounds")
end if
else
ibeg = LBOUND(hist_coords(indx)%real_values, 1)
end if
if (present(istop)) then
iend = istop
if (iend > UBOUND(hist_coords(indx)%real_values, 1)) then
call endrun(subname//": istop is outside the bounds")
end if
else
iend = UBOUND(hist_coords(indx)%real_values, 1)
end if
if (SIZE(rvalues) < (iend - ibeg + 1)) then
call endrun(subname//": rvalues too small")
end if
rndx = 1
do jndx = ibeg, iend
rvalues(rndx) = hist_coords(indx)%real_values(jndx)
rndx = rndx + 1
end do
end if
exit
end if
end do
if (present(found)) then
found = dim_ok
end if

end subroutine hist_dimension_values_r8

!#######################################################################

subroutine hist_dimension_values_int(name, ivalues, istart, istop, found)
! Given the name of a dimension, return its (integer) values in <ivalues>
! If <istart> and <istop> are present, they are the beginning and ending
! indices of the dimension values to return in <ivalues>. By default,
! the entire array is copied.
! If <found> is passed, return .true. if <name> is a defined dimension
! with integer values.

! Dummy arguments
character(len=*), intent(in) :: name
integer, intent(out) :: ivalues(:)
integer, optional, intent(in) :: istart
integer, optional, intent(in) :: istop
logical, optional, intent(out) :: found
! Local variables
integer :: indx, jndx, rndx
integer :: ibeg
integer :: iend
logical :: dim_ok
integer, parameter :: unset_i = huge(1)
character(len=*), parameter :: subname = 'hist_dimension_values_int'

dim_ok = .false.
peverwhee marked this conversation as resolved.
Show resolved Hide resolved
ivalues(:) = unset_i

do indx = 1, registeredmdims
if(trim(name) == trim(hist_coords(indx)%name)) then
dim_ok = associated(hist_coords(indx)%integer_values)
if (dim_ok) then
if (present(istart)) then
ibeg = istart
if (ibeg < LBOUND(hist_coords(indx)%integer_values, 1)) then
call endrun(subname//": istart is outside the bounds")
end if
else
ibeg = LBOUND(hist_coords(indx)%integer_values, 1)
end if
if (present(istop)) then
iend = istop
if (iend > UBOUND(hist_coords(indx)%integer_values, 1)) then
call endrun(subname//": istop is outside the bounds")
end if
else
iend = UBOUND(hist_coords(indx)%integer_values, 1)
end if
if (SIZE(ivalues) < (iend - ibeg + 1)) then
call endrun(subname//": ivalues too small")
end if
rndx = 1
do jndx = ibeg, iend
ivalues(rndx) = hist_coords(indx)%integer_values(jndx)
rndx = rndx + 1
end do
end if
exit
end if
end do
if (present(found)) then
found = dim_ok
end if

end subroutine hist_dimension_values_int

!#######################################################################

end module cam_history_support
9 changes: 7 additions & 2 deletions src/cpl/nuopc/atm_comp_nuopc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,7 @@ subroutine cam_orbital_update(clock, logunit, mastertask, eccen, obliqr, lambm0
integer :: year ! model year at current time
integer :: orb_year ! orbital year for current orbital computation
character(len=CL) :: msgstr ! temporary
logical, save :: logprint = .true.
character(len=*) , parameter :: subname = "(cam_orbital_update)"
!-------------------------------------------

Expand All @@ -1499,10 +1500,14 @@ subroutine cam_orbital_update(clock, logunit, mastertask, eccen, obliqr, lambm0
else
orb_year = orb_iyear
end if

if(.not. (logprint .and. mastertask)) then
logprint = .false.
endif

eccen = orb_eccen
call shr_orb_params(orb_year, eccen, orb_obliq, orb_mvelp, obliqr, lambm0, mvelpp, mastertask)

call shr_orb_params(orb_year, eccen, orb_obliq, orb_mvelp, obliqr, lambm0, mvelpp, logprint)
logprint = .false.
if ( eccen == SHR_ORB_UNDEF_REAL .or. obliqr == SHR_ORB_UNDEF_REAL .or. &
mvelpp == SHR_ORB_UNDEF_REAL .or. lambm0 == SHR_ORB_UNDEF_REAL) then
write (msgstr, *) subname//' ERROR: orb params incorrect'
Expand Down
6 changes: 6 additions & 0 deletions src/physics/cam/micro_pumas_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1324,7 +1324,13 @@ subroutine micro_pumas_cam_init(pbuf2d)
call pbuf_set_field(pbuf2d, bergso_idx, 0._r8)
call pbuf_set_field(pbuf2d, icswp_idx, 0._r8)
call pbuf_set_field(pbuf2d, cldfsnow_idx, 0._r8)
call pbuf_set_field(pbuf2d, dei_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, des_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, mu_idx, 0.0_r8)
call pbuf_set_field(pbuf2d, lambdac_idx, 0.0_r8)

if (degrau_idx > 0) call pbuf_set_field(pbuf2d, degrau_idx, 0.0_r8)
if (icgrauwp_idx > 0) call pbuf_set_field(pbuf2d, icgrauwp_idx, 0.0_r8)
nusbaume marked this conversation as resolved.
Show resolved Hide resolved
if (qrain_idx > 0) call pbuf_set_field(pbuf2d, qrain_idx, 0._r8)
if (qsnow_idx > 0) call pbuf_set_field(pbuf2d, qsnow_idx, 0._r8)
if (nrain_idx > 0) call pbuf_set_field(pbuf2d, nrain_idx, 0._r8)
Expand Down
Loading