From 4e3d036fa7afe09aec0a4304f9e8a26010f4c3d1 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 18 Aug 2015 10:27:32 -0600 Subject: [PATCH 01/46] Update to support 01col grid config_grids.xml now contains 01col_01col grid and config_pes.xml sets NTASKS = 1 for all components when running on said grid. --- machines/config_pes.xml | 9 +++++++++ scripts/Tools/config_grid.xml | 13 +++++++++++++ 2 files changed, 22 insertions(+) diff --git a/machines/config_pes.xml b/machines/config_pes.xml index 6c34bb355e5..458012f0fb8 100644 --- a/machines/config_pes.xml +++ b/machines/config_pes.xml @@ -96,6 +96,15 @@ 640 2 01 + + 1 1 0 1 + $NTASKS_ATM $NTHRDS_ATM $ROOTPE_ATM 1 + $NTASKS_ATM $NTHRDS_ATM $ROOTPE_ATM 1 + $NTASKS_ATM $NTHRDS_ATM $ROOTPE_ATM 1 + $NTASKS_ATM $NTHRDS_ATM $ROOTPE_ATM + $NTASKS_ATM $NTHRDS_ATM $ROOTPE_ATM 1 + + 2048 1 0 1 $NTASKS_ATM $NTHRDS_ATM $ROOTPE_ATM 1 diff --git a/scripts/Tools/config_grid.xml b/scripts/Tools/config_grid.xml index 0f9ab372268..5994be6331c 100644 --- a/scripts/Tools/config_grid.xml +++ b/scripts/Tools/config_grid.xml @@ -25,6 +25,7 @@ Each grid is associated with five names a%gx1v6_l%gx1v6_oi%gx1v6_r%rx1_m%gx1v6_g%null_w%null +a%01col_l%01col_oi%01col_r%null_m%01col_g%null_w%null a%CLM_USRDAT_l%CLM_USRDAT_oi%CLM_USRDAT_r%null_m%reg_g%null_w%null a%1x1_numaIA_l%1x1_numaIA_oi%1x1_numaIA_r%null_m%reg_g%null_w%null @@ -309,6 +310,11 @@ Each grid is associated with five names + + 1 1 + 01col is a single-column grid for datm and POP: + + 320 384 gx1v6 is Greenland pole v6 1-deg grid: @@ -526,6 +532,13 @@ do not use scientific experiments; use the T62_g16 resolution instead: + + domain.lnd.01col_01col.20150422.nc + domain.lnd.01col_01col.20150422.nc + domain.ocn.01col.20150422.nc + domain.ocn.01col.20150422.nc + + domain.lnd.${CLM_USRDAT_NAME}_navy.nc domain.lnd.${CLM_USRDAT_NAME}_navy.nc From 6cb90adae0a41d8e288ba44c87089d73928a599e Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 18 Aug 2015 17:30:13 -0600 Subject: [PATCH 02/46] Use single column datm forcing for 1D_1D res When $ATM_GRID = "01col" datm reads fluxs from single column files --- components/data_comps/datm/bld/build-namelist | 1 + .../datm/bld/namelist_files/namelist_defaults_datm.xml | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index eeef4fba3eb..ae2316a6866 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -420,6 +420,7 @@ $fh_out->open(">$CASEROOT/Buildconf/datm.input_data_list") or # Hash for parsing default_namelist_datm.xml my %default_namelist_opts; $default_namelist_opts{'grid'} = $GRID; +$default_namelist_opts{'atmgrid'} = $ATM_GRID; $default_namelist_opts{'datm_mode'} = $DATM_MODE; $default_namelist_opts{'presaero_mode'} = $DATM_PRESAERO; $default_namelist_opts{'datm_co2_tseries'} = $DATM_CO2_TSERIES; diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index f3d9e3ac3c7..4d876ce492d 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -640,8 +640,10 @@ Currently the following streams are supported (term definitions precede the stre 1 $DIN_LOC_ROOT/atm/datm7/NYF nyf.giss.T62.051007.nc +nyf.giss.01col.20150818.nc $DIN_LOC_ROOT/atm/datm7/NYF nyf.giss.T62.051007.nc +nyf.giss.01col.20150818.nc 0 linear @@ -664,8 +666,10 @@ Currently the following streams are supported (term definitions precede the stre 1 $DIN_LOC_ROOT/atm/datm7/NYF nyf.gxgxs.T62.051007.nc +nyf.gxgxs.01col.20150818.nc $DIN_LOC_ROOT/atm/datm7/NYF nyf.gxgxs.T62.051007.nc +nyf.gxgxs.01col.20150818.nc 0 linear @@ -686,8 +690,10 @@ Currently the following streams are supported (term definitions precede the stre 1 $DIN_LOC_ROOT/atm/datm7/NYF nyf.ncep.T62.050923.nc +nyf.ncep.01col.20150818.nc $DIN_LOC_ROOT/atm/datm7/NYF nyf.ncep.T62.050923.nc +nyf.ncep.01col.20150818.nc 0 linear From 8a093831743630734666643396467d5505e392f9 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 19 Aug 2015 14:41:00 -0600 Subject: [PATCH 03/46] Update factorfn default for 01col grid factorfn is a data file containing correction factors for datm. For the 01col I took specific values from the gx3v7 correction factor file. --- components/data_comps/datm/bld/build-namelist | 3 +++ .../datm/bld/namelist_files/namelist_defaults_datm.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index ae2316a6866..4591205c618 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -633,6 +633,9 @@ add_default($nl, 'atm_in' , 'val'=>"datm_atm_in${INST_STRING}"); add_default($nl, 'iradsw'); if ($DATM_MODE =~ /^CORE/) { my $factorfn = "$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc"; + if ($ATM_GRID eq "01col") { + $factorfn = "$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.01col.20150819.nc"; + } add_default($nl, 'factorfn', 'val'=>"$factorfn" ); } if ($DATM_PRESAERO eq "none" ) { diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 4d876ce492d..b552053c8f8 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -2262,6 +2262,7 @@ af.rlds.ccsm4.rcp45.2006-2300.nc unused $DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc +$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.01col.20150819.nc $DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc From fd09d4fadc7e41a7a99e5262ce601ded3ddd3790 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 25 Aug 2015 15:06:18 -0600 Subject: [PATCH 04/46] A few tweaks needed to run 01col grid 1) shr_map_mod assumes units are degrees for single column grids 2) seq_domain_mct loosens tolerance on some domain checks 3) config_grid.xml supports g37_g37 grid --- driver_cpl/driver/seq_domain_mct.F90 | 18 +++++++++--------- scripts/Tools/config_grid.xml | 11 +++++++---- share/csm_share/shr/shr_map_mod.F90 | 7 ++++++- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/driver_cpl/driver/seq_domain_mct.F90 b/driver_cpl/driver/seq_domain_mct.F90 index f99fb85c9c0..da689b1bdff 100644 --- a/driver_cpl/driver/seq_domain_mct.F90 +++ b/driver_cpl/driver/seq_domain_mct.F90 @@ -370,9 +370,9 @@ subroutine seq_domain_check( infodata, & if (atm_present .and. lnd_present .and. samegrid_al) then if (iamroot) write(logunit,F00) ' --- checking atm/land domains ---' - call seq_domain_check_grid(atmdom_a%data, lnddom_a%data, 'lat' , eps=eps_axgrid, mpicom=mpicom_cplid, mask=maskl) - call seq_domain_check_grid(atmdom_a%data, lnddom_a%data, 'lon' , eps=eps_axgrid, mpicom=mpicom_cplid, mask=maskl) - call seq_domain_check_grid(atmdom_a%data, lnddom_a%data, 'area', eps=eps_axarea, mpicom=mpicom_cplid, mask=maskl) + call seq_domain_check_grid(atmdom_a%data, lnddom_a%data, 'lat' , eps=eps_oigrid, mpicom=mpicom_cplid, mask=maskl) + call seq_domain_check_grid(atmdom_a%data, lnddom_a%data, 'lon' , eps=eps_oigrid, mpicom=mpicom_cplid, mask=maskl) + call seq_domain_check_grid(atmdom_a%data, lnddom_a%data, 'area', eps=eps_oiarea, mpicom=mpicom_cplid, mask=maskl) endif !------------------------------------------------------------------------------ @@ -381,16 +381,16 @@ subroutine seq_domain_check( infodata, & if (atm_present .and. ice_present .and. samegrid_ao) then if (iamroot) write(logunit,F00) ' --- checking atm/ice domains ---' - call seq_domain_check_grid(atmdom_a%data, icedom_a%data, 'lat' , eps=eps_axgrid, mpicom=mpicom_cplid, mask=maski) - call seq_domain_check_grid(atmdom_a%data, icedom_a%data, 'lon' , eps=eps_axgrid, mpicom=mpicom_cplid, mask=maski) - call seq_domain_check_grid(atmdom_a%data, icedom_a%data, 'area', eps=eps_axarea, mpicom=mpicom_cplid, mask=maski) + call seq_domain_check_grid(atmdom_a%data, icedom_a%data, 'lat' , eps=eps_oigrid, mpicom=mpicom_cplid, mask=maski) + call seq_domain_check_grid(atmdom_a%data, icedom_a%data, 'lon' , eps=eps_oigrid, mpicom=mpicom_cplid, mask=maski) + call seq_domain_check_grid(atmdom_a%data, icedom_a%data, 'area', eps=eps_oiarea, mpicom=mpicom_cplid, mask=maski) endif if (atm_present .and. ocn_present .and. samegrid_ao) then if (iamroot) write(logunit,F00) ' --- checking atm/ocn domains ---' - call seq_domain_check_grid(atmdom_a%data, ocndom_a%data, 'lat' , eps=eps_axgrid, mpicom=mpicom_cplid, mask=masko) - call seq_domain_check_grid(atmdom_a%data, ocndom_a%data, 'lon' , eps=eps_axgrid, mpicom=mpicom_cplid, mask=masko) - call seq_domain_check_grid(atmdom_a%data, ocndom_a%data, 'area', eps=eps_axarea, mpicom=mpicom_cplid, mask=masko) + call seq_domain_check_grid(atmdom_a%data, ocndom_a%data, 'lat' , eps=eps_oigrid, mpicom=mpicom_cplid, mask=masko) + call seq_domain_check_grid(atmdom_a%data, ocndom_a%data, 'lon' , eps=eps_oigrid, mpicom=mpicom_cplid, mask=masko) + call seq_domain_check_grid(atmdom_a%data, ocndom_a%data, 'area', eps=eps_oiarea, mpicom=mpicom_cplid, mask=masko) endif !------------------------------------------------------------------------------ diff --git a/scripts/Tools/config_grid.xml b/scripts/Tools/config_grid.xml index 5994be6331c..dfb416c9a09 100644 --- a/scripts/Tools/config_grid.xml +++ b/scripts/Tools/config_grid.xml @@ -25,6 +25,7 @@ Each grid is associated with five names a%gx1v6_l%gx1v6_oi%gx1v6_r%rx1_m%gx1v6_g%null_w%null +a%gx3v7_l%gx3v7_oi%gx3v7_r%rx1_m%gx3v7_g%null_w%null a%01col_l%01col_oi%01col_r%null_m%01col_g%null_w%null a%CLM_USRDAT_l%CLM_USRDAT_oi%CLM_USRDAT_r%null_m%reg_g%null_w%null @@ -404,6 +405,8 @@ do not use scientific experiments; use the T62_g16 resolution instead: + domain.ocn.gx3v7.120323.nc + domain.ocn.gx3v7.120323.nc domain.ocn.gx3v7.120323.nc domain.ocn.gx3v7.120323.nc @@ -533,10 +536,10 @@ do not use scientific experiments; use the T62_g16 resolution instead: - domain.lnd.01col_01col.20150422.nc - domain.lnd.01col_01col.20150422.nc - domain.ocn.01col.20150422.nc - domain.ocn.01col.20150422.nc + domain.ocn.01col.ArcticOcean.20150824.nc + domain.lnd.01col.ArcticOcean.20150824.nc + domain.ocn.01col.ArcticOcean.20150824.nc + domain.ocn.01col.ArcticOcean.20150824.nc diff --git a/share/csm_share/shr/shr_map_mod.F90 b/share/csm_share/shr/shr_map_mod.F90 index 7c8d3675748..8d02fda586c 100644 --- a/share/csm_share/shr/shr_map_mod.F90 +++ b/share/csm_share/shr/shr_map_mod.F90 @@ -2945,6 +2945,7 @@ subroutine shr_map_getWts(Xdst,Ydst,Xsrc,Ysrc,pti,ptj,ptw,pnum,units) if (yd > cpole + 1.0e-3 .or. & yd < -cpole - 1.0e-3) then write(s_logunit,*) trim(subname),' ERROR: yd outside bounds ',yd + write(s_logunit,*) trim(subname),' cpole = ', cpole call shr_map_abort(subName//' ERROR yd outside 90 degree bounds') endif if (yd > cpole) yd = cpole @@ -3375,7 +3376,11 @@ logical function shr_map_checkRad(Grid) shr_map_checkRad = .false. rmin = minval(Grid) rmax = maxval(Grid) - if ((rmax - rmin) < 1.01_SHR_KIND_R8*c2*pi) shr_map_checkRad = .true. + if (rmax.ne.rmin) then + shr_map_checkRad = ((rmax - rmin) < 1.01_SHR_KIND_R8*c2*pi) + else + shr_map_checkRad = .true. + end if end function shr_map_checkRad From 21af6dfb61e0505b915e9de231ecefd29ad72ea9 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 26 Aug 2015 10:51:28 -0600 Subject: [PATCH 05/46] Update datm defaults Don't want to use any 01col domains or datasets in datm --- components/data_comps/datm/bld/build-namelist | 3 --- .../datm/bld/namelist_files/namelist_defaults_datm.xml | 7 ------- 2 files changed, 10 deletions(-) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index 4591205c618..ae2316a6866 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -633,9 +633,6 @@ add_default($nl, 'atm_in' , 'val'=>"datm_atm_in${INST_STRING}"); add_default($nl, 'iradsw'); if ($DATM_MODE =~ /^CORE/) { my $factorfn = "$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc"; - if ($ATM_GRID eq "01col") { - $factorfn = "$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.01col.20150819.nc"; - } add_default($nl, 'factorfn', 'val'=>"$factorfn" ); } if ($DATM_PRESAERO eq "none" ) { diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index b552053c8f8..f3d9e3ac3c7 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -640,10 +640,8 @@ Currently the following streams are supported (term definitions precede the stre 1 $DIN_LOC_ROOT/atm/datm7/NYF nyf.giss.T62.051007.nc -nyf.giss.01col.20150818.nc $DIN_LOC_ROOT/atm/datm7/NYF nyf.giss.T62.051007.nc -nyf.giss.01col.20150818.nc 0 linear @@ -666,10 +664,8 @@ Currently the following streams are supported (term definitions precede the stre 1 $DIN_LOC_ROOT/atm/datm7/NYF nyf.gxgxs.T62.051007.nc -nyf.gxgxs.01col.20150818.nc $DIN_LOC_ROOT/atm/datm7/NYF nyf.gxgxs.T62.051007.nc -nyf.gxgxs.01col.20150818.nc 0 linear @@ -690,10 +686,8 @@ Currently the following streams are supported (term definitions precede the stre 1 $DIN_LOC_ROOT/atm/datm7/NYF nyf.ncep.T62.050923.nc -nyf.ncep.01col.20150818.nc $DIN_LOC_ROOT/atm/datm7/NYF nyf.ncep.T62.050923.nc -nyf.ncep.01col.20150818.nc 0 linear @@ -2262,7 +2256,6 @@ af.rlds.ccsm4.rcp45.2006-2300.nc unused $DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc -$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.01col.20150819.nc $DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc From d6c78e9d3cb329892fc03366ca747ad5d0f64b3e Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 26 Aug 2015 12:13:49 -0600 Subject: [PATCH 06/46] typo in LND_DOMAIN_FILE for 01col --- scripts/Tools/config_grid.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Tools/config_grid.xml b/scripts/Tools/config_grid.xml index dfb416c9a09..e0b42d5b6d6 100644 --- a/scripts/Tools/config_grid.xml +++ b/scripts/Tools/config_grid.xml @@ -537,7 +537,7 @@ do not use scientific experiments; use the T62_g16 resolution instead: domain.ocn.01col.ArcticOcean.20150824.nc - domain.lnd.01col.ArcticOcean.20150824.nc + domain.ocn.01col.ArcticOcean.20150824.nc domain.ocn.01col.ArcticOcean.20150824.nc domain.ocn.01col.ArcticOcean.20150824.nc From 4540983d7c0f30402fcad43b037ee411a7b28a3d Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 28 Aug 2015 13:46:39 -0600 Subject: [PATCH 07/46] Add C1DIAF compset / update datm streams Created an inter-annual forcing 1D compset and a corresponding datm stream that will use data from SOFS. --- components/data_comps/datm/bld/build-namelist | 1 + .../namelist_files/namelist_defaults_datm.xml | 35 +++++++++++++++++++ scripts/Tools/config_compsets.xml | 1 + 3 files changed, 37 insertions(+) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index ae2316a6866..30c0bd4cba5 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -424,6 +424,7 @@ $default_namelist_opts{'atmgrid'} = $ATM_GRID; $default_namelist_opts{'datm_mode'} = $DATM_MODE; $default_namelist_opts{'presaero_mode'} = $DATM_PRESAERO; $default_namelist_opts{'datm_co2_tseries'} = $DATM_CO2_TSERIES; +$default_namelist_opts{'atm_grid'} = $ATM_GRID; # Create streams template file(s) - loop over streams my $streams = $defaults->get_value( "streamslist", \%default_namelist_opts ); diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index f3d9e3ac3c7..8c12eb89893 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -164,6 +164,7 @@ Currently the following streams are supported (term definitions precede the stre CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor +CORE2_IAF.01col CPLHIST3HrWx.Solar,CPLHIST3HrWx.Precip,CPLHIST3HrWx.nonSolarNonPrecip WW3 @@ -723,6 +724,40 @@ Currently the following streams are supported (term definitions precede the stre + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.01col.SouthernOcean.20150824.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.buoy.01col.2010-2011.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + + lwdn lwdn + swdn swdn + swup swup + prc prec + dn10 dens + slp_ pslv + q_10 shum + t_10 tbot + u_10 u + v_10 v + + 1948 diff --git a/scripts/Tools/config_compsets.xml b/scripts/Tools/config_compsets.xml index 8b14f2792ff..a76897d3b3a 100644 --- a/scripts/Tools/config_compsets.xml +++ b/scripts/Tools/config_compsets.xml @@ -414,6 +414,7 @@ value of RUN_STARTDATE will be date2. 2000_CAM4_CLM40%SP_CICE_POP2%1D_RTM_SGLC_SWAV 2000_DATM%NYF_SLND_DICE%SSMI_POP2%1D_DROF%NYF_SGLC_SWAV +2000_DATM%IAF_SLND_DICE%SIAF_POP2%1D_DROF%IAF_SGLC_SWAV 1850_DATM%NYF_SLND_DICE%SSMI_POP2%1D_POP2%ECO_DROF%NYF_SGLC_SWAV 2000_DATM%NYF_SLND_CICE_POP2%1D_DROF%NYF_SGLC_SWAV From 18aa3a29836cd644d1c1e05d14f08cf089508861 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Fri, 28 Aug 2015 15:00:06 -0600 Subject: [PATCH 08/46] Quick datm update for 01col IAF Don't want to use a factorfn file (I don't think). --- components/data_comps/datm/bld/build-namelist | 5 ++--- .../datm/bld/namelist_files/namelist_defaults_datm.xml | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index 30c0bd4cba5..abfe951f4f8 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -420,11 +420,10 @@ $fh_out->open(">$CASEROOT/Buildconf/datm.input_data_list") or # Hash for parsing default_namelist_datm.xml my %default_namelist_opts; $default_namelist_opts{'grid'} = $GRID; -$default_namelist_opts{'atmgrid'} = $ATM_GRID; +$default_namelist_opts{'atm_grid'} = $ATM_GRID; $default_namelist_opts{'datm_mode'} = $DATM_MODE; $default_namelist_opts{'presaero_mode'} = $DATM_PRESAERO; $default_namelist_opts{'datm_co2_tseries'} = $DATM_CO2_TSERIES; -$default_namelist_opts{'atm_grid'} = $ATM_GRID; # Create streams template file(s) - loop over streams my $streams = $defaults->get_value( "streamslist", \%default_namelist_opts ); @@ -632,7 +631,7 @@ add_default($nl, 'dtlimit', 'val' => "$odtlimit" ); add_default($nl, 'atm_in' , 'val'=>"datm_atm_in${INST_STRING}"); add_default($nl, 'iradsw'); -if ($DATM_MODE =~ /^CORE/) { +if ($DATM_MODE =~ /^CORE/ && $ATM_GRID ne "01col") { my $factorfn = "$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc"; add_default($nl, 'factorfn', 'val'=>"$factorfn" ); } diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 8c12eb89893..9a686764cad 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -729,7 +729,7 @@ Currently the following streams are supported (term definitions precede the stre 2011 1 $DIN_LOC_ROOT/share/domains -domain.01col.SouthernOcean.20150824.nc +domain.ocn.01col.SOFS.20150828.nc $DIN_LOC_ROOT/ocn/iaf SOFS.buoy.01col.2010-2011.nc @@ -2292,6 +2292,7 @@ af.rlds.ccsm4.rcp45.2006-2300.nc unused $DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc $DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc +unused From af95400d2c8ea133364d88516f1e82d3c3830e23 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Tue, 15 Sep 2015 14:00:40 -0600 Subject: [PATCH 09/46] Update C1DIAF streams Use Svetlana's data files for C1DIAF compset. Also updated how csm_share looks for units of degrees (so it accepts degrees_north and degrees_east as well). I also added "factorfn" back to the datm namelist, not sure why that change got removed... --- components/data_comps/datm/bld/build-namelist | 2 +- .../namelist_files/namelist_defaults_datm.xml | 91 ++++++++++++++----- share/csm_share/shr/shr_map_mod.F90 | 2 +- 3 files changed, 72 insertions(+), 23 deletions(-) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index abfe951f4f8..f84c1723e89 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -631,7 +631,7 @@ add_default($nl, 'dtlimit', 'val' => "$odtlimit" ); add_default($nl, 'atm_in' , 'val'=>"datm_atm_in${INST_STRING}"); add_default($nl, 'iradsw'); -if ($DATM_MODE =~ /^CORE/ && $ATM_GRID ne "01col") { +if ($DATM_MODE =~ /^CORE/) { my $factorfn = "$DIN_LOC_ROOT/atm/datm7/CORE2/COREv2.correction_factors.T62.121007.nc"; add_default($nl, 'factorfn', 'val'=>"$factorfn" ); } diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 9a686764cad..8ff452a48fc 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -164,7 +164,7 @@ Currently the following streams are supported (term definitions precede the stre CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor -CORE2_IAF.01col +CORE2_IAF.NCEP.SOFS,CORE2_IAF.SOFS.DAILY,CORE2_IAF.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor CPLHIST3HrWx.Solar,CPLHIST3HrWx.Precip,CPLHIST3HrWx.nonSolarNonPrecip WW3 @@ -725,37 +725,86 @@ Currently the following streams are supported (term definitions precede the stre -2010 -2011 -1 -$DIN_LOC_ROOT/share/domains -domain.ocn.01col.SOFS.20150828.nc -$DIN_LOC_ROOT/ocn/iaf - -SOFS.buoy.01col.2010-2011.nc + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +ncep.SOFS.2010.nc -linear -1.5 -0 - +linear +1.5 +0 + time time xc lon yc lat area area mask mask - + + dn10 dens + slp_ pslv + + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.daily.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + + prec prec lwdn lwdn swdn swdn swup swup - prc prec - dn10 dens - slp_ pslv - q_10 shum - t_10 tbot - u_10 u - v_10 v + + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.6hour.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + + q3_5 shum + t3_5 tbot + u3_5 u + v3_5 v diff --git a/share/csm_share/shr/shr_map_mod.F90 b/share/csm_share/shr/shr_map_mod.F90 index 8d02fda586c..ca0c1b35717 100644 --- a/share/csm_share/shr/shr_map_mod.F90 +++ b/share/csm_share/shr/shr_map_mod.F90 @@ -2919,7 +2919,7 @@ subroutine shr_map_getWts(Xdst,Ydst,Xsrc,Ysrc,pti,ptj,ptw,pnum,units) !--- is lat/lon degrees or radians? needed for X wraparound --- if (present(units)) then - if (trim(units) == 'degrees') then + if (index(units,'degrees').ne.0) then csize = 360._SHR_KIND_R8 elseif (trim(units) == 'radians') then csize = c2*pi From 9a0870dbccf25417f4a34e18b5a2276c2123f38e Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 16 Sep 2015 14:07:05 -0600 Subject: [PATCH 10/46] Patch to allow RESUBMIT to work --- machines/config_machines.xml | 5 +- machines/template.cesmrun | 8 +- utils/perl5lib/Batch/BatchUtils.pm | 132 +++++++++++++++-------------- 3 files changed, 74 insertions(+), 71 deletions(-) diff --git a/machines/config_machines.xml b/machines/config_machines.xml index a6845e8687e..f9e6b7c73ba 100644 --- a/machines/config_machines.xml +++ b/machines/config_machines.xml @@ -1108,13 +1108,12 @@ TRUE - caldera - small regular capability + caldera - 2:00 + 1:00 2:00 4:00 8:00 diff --git a/machines/template.cesmrun b/machines/template.cesmrun index dbe769a32bc..b0c14a8626f 100644 --- a/machines/template.cesmrun +++ b/machines/template.cesmrun @@ -29,10 +29,6 @@ require Depends::Checks; require Module::ModuleLoader; require Batch::BatchUtils; -# Set OMP_NUM_THREADS -$ENV{'OMP_NUM_THREADS'} = {{ thread_count }}; - - #------------------------------------------------------------------------------ # PE Layout Documentation: #------------------------------------------------------------------------------ @@ -310,6 +306,10 @@ sub runCESM() system("sleep 10"); my $localtime = localtime; print "$localtime CESM EXECUTION BEGINS HERE\n"; + + # Set OMP_NUM_THREADS + $ENV{'OMP_NUM_THREADS'} = {{ thread_count }}; + # Run the model {{ mpirun }} $localtime = localtime; diff --git a/utils/perl5lib/Batch/BatchUtils.pm b/utils/perl5lib/Batch/BatchUtils.pm index af227c97e72..e3d9bcf701a 100755 --- a/utils/perl5lib/Batch/BatchUtils.pm +++ b/utils/perl5lib/Batch/BatchUtils.pm @@ -9,45 +9,43 @@ use strict; use warnings; package Batch::BatchUtils; -use Data::Dumper; use Cwd; use Exporter qw(import); use XML::LibXML; require Batch::BatchMaker; use lib '.'; #============================================================================== -# Base class constructor. required args are the case name, caseroot, cime/cesmroot, -# compiler, machine, machine root directory, the mpi library, and the scriptsroot. +# Base class constructor. required args are the case name, caseroot, cime root, +# compiler, machine, machine root directory, the mpi library, # get the paths to the config_machines and config_batch xml files, and figure out # the batch system type. #============================================================================== sub new { - my ($class, %params) = @_; - my $self = { - case => $params{'case'} || undef, - caseconfig => $params{'caseconfig'} || undef, - caseroot => $params{'caseroot'} || undef, - ccsmroot => $params{'ccsmroot'} || undef, - compiler => $params{'compiler'} || undef, - machine => $params{'machine'} || undef, - machroot => $params{'machroot'} || undef, - mpilib => $params{'mpilib'} || undef, - scriptsroot => $params{'scriptsroot'} || undef, - }; - bless $self, $class; + my ($class, %params) = @_; + my $self = { + case => $params{'case'} || undef, + caseconfig => $params{'caseconfig'} || undef, + caseroot => $params{'caseroot'} || undef, + cimeroot => $params{'cimeroot'} || undef, + compiler => $params{'compiler'} || undef, + machine => $params{'machine'} || undef, + machroot => $params{'machroot'} || undef, + mpilib => $params{'mpilib'} || undef, + }; + bless $self, $class; my $perl5libdir = undef; - my $configbatch = $self->{'machroot'} . "/config_batch.xml"; - $self->{'configbatch'} = $configbatch; - my $configmachines = $self->{'machroot'} . "/config_machines.xml"; - $self->{'configmachines'} = $configmachines; + my $configbatch = $self->{'machroot'} . "/config_batch.xml"; + $self->{'configbatch'} = $configbatch; + my $configmachines = $self->{'machroot'} . "/config_machines.xml"; + $self->{'configmachines'} = $configmachines; my $casetoolsdir = $self->{'caseroot'} . "/Tools"; push(@INC, $casetoolsdir); my $xml = XML::LibXML->new(no_blanks => 1); my $machineconfig = $xml->parse_file($configmachines); my $root = $machineconfig->getDocumentElement(); - + my @batchtypes = $root->findnodes("/config_machines/machine[\@MACH=\'$self->{machine}\']/batch_system"); if(! @batchtypes) { @@ -55,9 +53,10 @@ sub new } $self->{'batchtype'} = $batchtypes[0]->getAttribute('type'); - $self->{dependencyqueue} = undef; - return $self; + $self->{dependencyqueue} = undef; + return $self; } + sub _check() { my $self = shift; @@ -183,7 +182,7 @@ sub submitSingleJob() my %config = %{$self->{'caseconfig'}}; my $dependarg = ''; my $submitargs = ''; - $submitargs = $self->getSubmitArguments($scriptname, $dependentJobId); + $submitargs = $self->getSubmitArguments($scriptname, $dependentJobId); if(! defined $submitargs && length($submitargs) <= 0) { $submitargs = '' ; @@ -208,8 +207,9 @@ sub submitSingleJob() #$ENV{'sta_ok'} = 'FALSE'; delete $ENV{'sta_ok'}; } - print "Submitting CESM job script $scriptname\n"; + print "Submitting job script $scriptname\n"; #my $runcmd = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} ./$scriptname $sta_argument"; + chdir $config{'CASEROOT'}; my $runcmd = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} ./$scriptname "; my $output; @@ -239,10 +239,8 @@ sub submitSingleJob() #============================================================================== sub doResubmit() { - my $self = shift; - my $islastjob = shift; - my $resubmit = shift; - my $sta_ok = shift; + my ($self, $islastjob, $resubmit, $scriptname, $sta_ok) = @_; + # If the islastjob flag is true, and resubmit is > 0, do the dependency # check and job resubmission again @@ -254,6 +252,10 @@ sub doResubmit() my $newresubmit = $config{'RESUBMIT'} - 1; my $owd = getcwd; chdir $config{'CASEROOT'}; + if ($config{COMP_RUN_BARRIERS} ne "TRUE"){ + `./xmlchange CONTINUE_RUN=TRUE`; + } + `./xmlchange -file env_run.xml -id RESUBMIT -val $newresubmit`; if($?) { @@ -269,16 +271,16 @@ sub doResubmit() } #============================================================================== -# If we need to resubmit a CESM job + post-run jobs, this subroutine will check the +# If we need to resubmit a job + post-run jobs, this subroutine will check the # env*.xml variables to see which jobs need to be resubmitted. -# For now, we are only handling cesm runs and the short-term archiver. +# For now, we are only handling runs and the short-term archiver. #============================================================================== sub dependencyCheck() { my $self = shift; my $sta_ok; my %config = %{$self->{'caseconfig'}}; - # we always want to run the CESM test or run again.. + # we always want to run the test or run again.. if(-e "$config{'CASE'}.test") { my $jobname = "$config{'CASE'}.test"; @@ -350,11 +352,14 @@ sub getSubmitArguments() my $scriptname = shift; my $dependentjobid = shift; - # Get a BatchMaker instance, we need its instance data. - my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, case => $self->{case}, - mpilib => $self->{mpilib}, scriptsroot => $self->{scriptsroot}, - machroot => $self->{machroot}, machine => $self->{machine}, - compiler => $self->{compiler} ); + # Get a BatchMaker instance, we need its instance data. + my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, + cimeroot => $self->{cimeroot}, + case => $self->{case}, + mpilib => $self->{mpilib}, + machroot => $self->{machroot}, + machine => $self->{machine}, + compiler => $self->{compiler} ); # Find the submit arguments for this particular batch system. @@ -416,19 +421,20 @@ sub getSubmitArguments() package Batch::BatchUtilsFactory; use Exporter qw(import); use XML::LibXML; -use Data::Dumper; + sub getBatchUtils { my (%params) = @_; # We need a machine to be defined my $machine = $params{'machine'}; - if(!defined $machine) - { - die "BatchUtilsFactory: machine must be defined!"; - } + if(!defined $machine) + { + die "BatchUtilsFactory: machine must be defined!"; + } + # Find the batch system type based on the machine. - my $batchtype = getBatchSystemType($params{'machine'}, $params{'machroot'}, $params{'caseroot'}); + my $batchtype = getBatchSystemType($params{'machine'}, $params{'machroot'}, $params{'caseroot'}); # Make a new base class my $batchutils = Batch::BatchUtils->new(%params); @@ -455,9 +461,9 @@ sub getBatchUtils return $batchutils; } else - { - bless $batchutils, "Batch::BatchUtils"; - } + { + bless $batchutils, "Batch::BatchUtils"; + } # Now try to create the batch-system specific class. $rv = eval @@ -514,18 +520,18 @@ sub getBatchSystemType() # Mira/ALCF specific BatchUtils class, since the workflow for ALCF has to be # completely different. # Current workflow: -# Run the CESM run on Mira or Cetus. When done, ssh over to tukeylogin1 and submit +# Run on Mira or Cetus. When done, ssh over to tukeylogin1 and submit # the short-term archive run. If we need to continue and resubmit, we will then -# ssh back to either Mira or Cetus and resubmit the CESM run. +# ssh back to either Mira or Cetus and resubmit the run. #============================================================================== package Batch::BatchUtils_mira; use base qw( Batch::BatchUtils ); -use Data::Dumper; + use Cwd; #============================================================================== # Overridden submitJobs() method for Mira. -# For ALCF, we really only want this method to submit the CESM run. +# For ALCF, we really only want this method to submit the run. # The short-term archiver and resubmission will be handled elsewhere. #============================================================================== sub submitJobs() @@ -543,14 +549,14 @@ sub submitJobs() # Get the first job name. my $firstjobname = $$firstjobarray[0]; - # submit the CESM run, and nothing else. + # submit the run, and nothing else. $depjobid = $self->submitSingleJob($firstjobname, $depjobid, 0, $sta_ok); } #============================================================================== # ALCF-specific single job submission. # The trick with ALCF is when we need to know which machine to ssh back to -# to resubmit the CESM run. +# to resubmit the run. # So, write a 'workflowhostfile' which contains the hostname we need to ssh back to # to resubmit the run. # mira submitSingleJob @@ -596,7 +602,7 @@ sub submitSingleJob() $submitargs .= " --env islastjob=TRUE "; } - print "Submitting CESM job script $scriptname\n"; + print "Submitting job script $scriptname\n"; my $runcmd = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} ./$scriptname"; my $output; @@ -617,17 +623,13 @@ sub submitSingleJob() return undef; } #============================================================================== -# Mira-specific doResubmit call. If this is called from the cesm run, then we +# Mira-specific doResubmit call. If this is called from the run, then we # have to ssh over to tukey and run the short-term archiver. # If called from the short-term archiver, #============================================================================== sub doResubmit() { - my $self = shift; - my $islastjob = shift; - my $resubmit = shift; - my $scriptname = shift; - my $sta_ok = shift; + my ($self, $islastjob, $resubmit, $scriptname, $sta_ok) = @_; my %config = %{$self->{'caseconfig'}}; if(defined $sta_ok) @@ -707,7 +709,7 @@ sub doResubmit() } my $submitstuff = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} $starchivescript"; - #my $cmd = "ssh tukeylogin1 qsub -A CESM_Atmos -t 60 -n 1 -q default --mode script ./$starchivescript"; + #my $cmd = "ssh tukeylogin1 qsub -A Atmos -t 60 -n 1 -q default --mode script ./$starchivescript"; my $runcmd = "ssh tukeylogin1 $submitstuff"; qx($runcmd) or die "could not exec cmd $runcmd, $!"; } @@ -784,10 +786,12 @@ sub getSubmitArguments() my $dependentjobid = shift; my $sta_ok = shift; - my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, case => $self->{case}, - mpilib => $self->{mpilib}, scriptsroot => $self->{scriptsroot}, - machroot => $self->{machroot}, machine => $self->{machine}, - compiler => $self->{compiler} ); + my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, + case => $self->{case}, + mpilib => $self->{mpilib}, + machroot => $self->{machroot}, + machine => $self->{machine}, + compiler => $self->{compiler} ); # Set the node count to 1 if this is the short-term archive script. if(defined $scriptname && $scriptname =~ /archive/) From 4f518aab44eebb97c1b00e7cbddfa70b98273af4 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 21 Oct 2015 12:16:11 -0600 Subject: [PATCH 11/46] update .gitignore in mapping tools --- .gitignore | 2 ++ tools/mapping/.gitignore | 14 ++++++++++++++ .../gen_mapping_files/runoff_to_ocn/.gitignore | 11 ----------- 3 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 .gitignore create mode 100644 tools/mapping/.gitignore delete mode 100644 tools/mapping/gen_mapping_files/runoff_to_ocn/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..a515a19b357 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/env_mach_specific.xml +**/.env_mach_specific.* diff --git a/tools/mapping/.gitignore b/tools/mapping/.gitignore new file mode 100644 index 00000000000..209e8757c47 --- /dev/null +++ b/tools/mapping/.gitignore @@ -0,0 +1,14 @@ +gen_mapping_files/runoff_to_ocn/runoff_map +**/*.nc +**/obj +**/src/*.o +**/src/*.mod +**/src/Macros.make +**/src/env_mach_specific.xml +**/src/.env_mach_specific.* +**/src/makdep +**/src/*.d +**/src/Depends* +map_field/map_field +check_maps/ESMF_RegridWeightGenCheck +gen_domain_files/gen_domain diff --git a/tools/mapping/gen_mapping_files/runoff_to_ocn/.gitignore b/tools/mapping/gen_mapping_files/runoff_to_ocn/.gitignore deleted file mode 100644 index 3efc32c46fd..00000000000 --- a/tools/mapping/gen_mapping_files/runoff_to_ocn/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -runoff_map -*.nc -obj -src/*.o -src/*.mod -src/Macros -src/build.csh -src/env_mach_specific -src/makdep -src/*.d -src/Depends* From b04f58a6f1fd34f92b944a215aa40bde689c014b Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 21 Oct 2015 12:17:06 -0600 Subject: [PATCH 12/46] didn't mean to commit .gitignore at cime/ level --- .gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index a515a19b357..00000000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -**/env_mach_specific.xml -**/.env_mach_specific.* From e314c1f009c77779f4018fc6e4de25eb8770fc8b Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 21 Oct 2015 12:23:41 -0600 Subject: [PATCH 13/46] one last gitignore update --- tools/mapping/.gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/mapping/.gitignore b/tools/mapping/.gitignore index 209e8757c47..3b590b9b1a5 100644 --- a/tools/mapping/.gitignore +++ b/tools/mapping/.gitignore @@ -3,12 +3,14 @@ gen_mapping_files/runoff_to_ocn/runoff_map **/obj **/src/*.o **/src/*.mod +**/src/*.d **/src/Macros.make **/src/env_mach_specific.xml **/src/.env_mach_specific.* **/src/makdep -**/src/*.d **/src/Depends* map_field/map_field check_maps/ESMF_RegridWeightGenCheck gen_domain_files/gen_domain +gen_mapping_files/runoff_to_ocn/src/* +!gen_mapping_files/runoff_to_ocn/src/*.F90 From 3c760361e3e383d66f474c84e7833ad06ea37e26 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 21 Oct 2015 12:34:05 -0600 Subject: [PATCH 14/46] split NCEP streams into multiple files --- .../namelist_files/namelist_defaults_datm.xml | 49 ++++++++++++++----- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 8ff452a48fc..655012a6381 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -164,7 +164,7 @@ Currently the following streams are supported (term definitions precede the stre CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor -CORE2_IAF.NCEP.SOFS,CORE2_IAF.SOFS.DAILY,CORE2_IAF.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor +CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.SOFS.DAILY,CORE2_IAF.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor CPLHIST3HrWx.Solar,CPLHIST3HrWx.Precip,CPLHIST3HrWx.nonSolarNonPrecip WW3 @@ -726,28 +726,51 @@ Currently the following streams are supported (term definitions precede the stre -2010 -2011 -1 -$DIN_LOC_ROOT/share/domains -domain.ocn.01col.SOFS.20150828.nc -$DIN_LOC_ROOT/ocn/iaf - +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + ncep.SOFS.2010.nc -linear -1.5 -0 - +linear +1.5 +0 + time time xc lon yc lat area area mask mask - + dn10 dens + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +ncep.SOFS.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + slp_ pslv From f742ae105502f835939b97f11fecd2460b952be0 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 21 Oct 2015 12:43:12 -0600 Subject: [PATCH 15/46] split daily SOFS streams into multiple files --- .../namelist_files/namelist_defaults_datm.xml | 99 ++++++++++++++++--- 1 file changed, 84 insertions(+), 15 deletions(-) diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 655012a6381..977e44215e4 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -164,7 +164,7 @@ Currently the following streams are supported (term definitions precede the stre CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor -CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.SOFS.DAILY,CORE2_IAF.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor +CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.PREC.SOFS.DAILY,CORE2_IAF.LWDN.SOFS.DAILY,CORE2_IAF.SWDN.SOFS.DAILY,CORE2_IAF.SWUP.SOFS.DAILY,CORE2_IAF.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor CPLHIST3HrWx.Solar,CPLHIST3HrWx.Precip,CPLHIST3HrWx.nonSolarNonPrecip WW3 @@ -725,7 +725,7 @@ Currently the following streams are supported (term definitions precede the stre - + 2010 2011 1 @@ -775,34 +775,103 @@ ncep.SOFS.2010.nc -2010 -2011 -1 -$DIN_LOC_ROOT/share/domains -domain.ocn.01col.SOFS.20150828.nc -$DIN_LOC_ROOT/ocn/iaf - +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + SOFS.daily.03-09.2010.nc -linear -1.5 -0 - +linear +1.5 +0 + time time xc lon yc lat area area mask mask - + prec prec + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.daily.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + lwdn lwdn + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.daily.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + swdn swdn + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.daily.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + swup swup - + 2010 2011 1 From 1ca6def75138ac3a41ff9dae652d1df32162fdef Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 21 Oct 2015 12:47:49 -0600 Subject: [PATCH 16/46] split 6-hourly SOFS streams into multiple files --- .../namelist_files/namelist_defaults_datm.xml | 95 ++++++++++++++++--- 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 977e44215e4..ba16cae2499 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -164,7 +164,7 @@ Currently the following streams are supported (term definitions precede the stre CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor -CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.PREC.SOFS.DAILY,CORE2_IAF.LWDN.SOFS.DAILY,CORE2_IAF.SWDN.SOFS.DAILY,CORE2_IAF.SWUP.SOFS.DAILY,CORE2_IAF.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor +CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.PREC.SOFS.DAILY,CORE2_IAF.LWDN.SOFS.DAILY,CORE2_IAF.SWDN.SOFS.DAILY,CORE2_IAF.SWUP.SOFS.DAILY,CORE2_IAF.SHUM.SOFS.6HOUR,CORE2_IAF.TBOT.SOFS.6HOUR,CORE2_IAF.U.SOFS.6HOUR,CORE2_IAF.V.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor CPLHIST3HrWx.Solar,CPLHIST3HrWx.Precip,CPLHIST3HrWx.nonSolarNonPrecip WW3 @@ -872,30 +872,99 @@ SOFS.daily.03-09.2010.nc -2010 -2011 -1 -$DIN_LOC_ROOT/share/domains -domain.ocn.01col.SOFS.20150828.nc -$DIN_LOC_ROOT/ocn/iaf - +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + SOFS.6hour.03-09.2010.nc -linear -1.5 -0 - +linear +1.5 +0 + time time xc lon yc lat area area mask mask - + q3_5 shum + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.6hour.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + t3_5 tbot + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.6hour.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + u3_5 u + + +2010 +2011 +1 +$DIN_LOC_ROOT/share/domains +domain.ocn.01col.SOFS.20150828.nc +$DIN_LOC_ROOT/ocn/iaf + +SOFS.6hour.03-09.2010.nc + + +linear +1.5 +0 + + time time + xc lon + yc lat + area area + mask mask + + v3_5 v From c88521bf98cf60508a61d25720fdf84f2353436e Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 25 Nov 2015 15:58:32 -0700 Subject: [PATCH 17/46] Add in GSWP3 for CLM Add in ability of datm to handle GSwP3 data for CLM Fixes: 315 Code review: none --- .../namelist_files/namelist_defaults_datm.xml | 85 +++++++++++++++++++ .../namelist_definition_datm.xml | 2 +- .../datm/cime_config/config_component.xml | 28 +++++- 3 files changed, 112 insertions(+), 3 deletions(-) diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index f3d9e3ac3c7..849b28c2cba 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -41,6 +41,7 @@ Currently the following streams are supported (term definitions precede the stre CLM_QIAN = Run with the CLM Qian dataset valid from 1948 to 2004 (force CLM) CLMCRUNCEP = Run with the CLM CRU NCEP V4 ( default ) forcing valid from 1900 to 2010 (force CLM) CLMCRUNCEP_V5 = Run with the CLM CRU NCEP V5 forcing valid from 1900 to 2010 (force CLM) + CLMGSWP3 = Run with the CLM GSWP3 forcing (force CLM) CLM1PT = Run with supplied single point data (force CLM) CORE2_NYF = CORE2 normal year forcing (for forcing POP and CICE) CORE2_IAF = CORE2 intra-annual year forcing (for forcing POP and CICE) @@ -92,6 +93,10 @@ Currently the following streams are supported (term definitions precede the stre CLMCRUNCEP_V5.Precip CLMCRUNCEP_V5.TPQW + CLMGSWP3.Solar + CLMGSWP3.Precip + CLMGSWP3.TPQW + co2tseries.20tr co2tseries.rcp2.6 co2tseries.rcp4.5 @@ -149,6 +154,7 @@ Currently the following streams are supported (term definitions precede the stre CLMNCEP CLMNCEP CLMNCEP +CLMNCEP CPLHIST CORE2_NYF CORE2_IAF @@ -162,6 +168,7 @@ Currently the following streams are supported (term definitions precede the stre CLM1PT.$ATM_GRID CLMCRUNCEP.Solar,CLMCRUNCEP.Precip,CLMCRUNCEP.TPQW CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW +CLMGSWP3_V5.Solar,CLMGSWP3_V5.Precip,CLMGSWP3_V5.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor CPLHIST3HrWx.Solar,CPLHIST3HrWx.Precip,CPLHIST3HrWx.nonSolarNonPrecip @@ -175,6 +182,7 @@ Currently the following streams are supported (term definitions precede the stre null null null +null null null u:v @@ -630,6 +638,83 @@ Currently the following streams are supported (term definitions precede the stre PSRF pbot + + + + + +$DATM_CLMNCEP_YR_START +$DATM_CLMNCEP_YR_END +$DATM_CLMNCEP_YR_ALIGN +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016 +domain.GSWP3.c2014.0.5d.nc +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016/Solar6Hrly +clmforc.GSWP3.c2011.0.5x0.5.Solr.%ym.nc +0 +coszen +bilinear +copy + + time time + xc lon + yc lat + area area + mask mask + + + FSDS swdn + + + +$DATM_CLMNCEP_YR_START +$DATM_CLMNCEP_YR_END +$DATM_CLMNCEP_YR_ALIGN +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016 +domain.GSWP3.c2014.0.5d.nc +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016/Precip +clmforc.GSWP3.c2011.0.5x0.5.Prec.%ym.nc +0 +nearest +bilinear +copy + + time time + xc lon + yc lat + area area + mask mask + + + PRECTmms precn + + + +$DATM_CLMNCEP_YR_START +$DATM_CLMNCEP_YR_END +$DATM_CLMNCEP_YR_ALIGN +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016 +domain.GSWP3.c2014.0.5d.nc +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016/TPHWL +clmforc.GSWP3.c2011.0.5x0.5.TPQWL.%ym.nc +0 +linear +bilinear +copy + + time time + xc lon + yc lat + area area + mask mask + + + TBOT tbot + WIND wind + QBOT shum + PSRF pbot + FLDS lwdn + + diff --git a/components/data_comps/datm/bld/namelist_files/namelist_definition_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_definition_datm.xml index f48ee16b59d..1fae957ebd5 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_definition_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_definition_datm.xml @@ -12,7 +12,7 @@ type="char*256" category="datm_setting" group="datm_env_settings" -valid_values="CLM_QIAN,CLM1PT,CLMCRUNCEP,CLMCRUNCEP_V5,CPLHIST3HrWx,CORE2_NYF,CORE2_IAF,COPYALL_NPS_v1,COPYALL_CORE2_v1,WW3"> +valid_values="CLM_QIAN,CLM1PT,CLMCRUNCEP,CLMCRUNCEP_V5,CLMGSWP3,CPLHIST3HrWx,CORE2_NYF,CORE2_IAF,COPYALL_NPS_v1,COPYALL_CORE2_v1,WW3"> Data Model mode to process forcing data diff --git a/components/data_comps/datm/cime_config/config_component.xml b/components/data_comps/datm/cime_config/config_component.xml index ecd0b910425..47d162a6e3e 100644 --- a/components/data_comps/datm/cime_config/config_component.xml +++ b/components/data_comps/datm/cime_config/config_component.xml @@ -15,13 +15,13 @@ char - CORE2_NYF,CORE2_IAF,TN460,CLM_QIAN,CLM1PT,CLMCRUNCEP,CLMCRUNCEP_V5,CPLHIST3HrWx,COPYALL_NPS_v1,COPYALL_NPS_CORE2_v1,WRF,WW3 + CORE2_NYF,CORE2_IAF,TN460,CLM_QIAN,CLM1PT,CLMCRUNCEP,CLMCRUNCEP_V5,CLMGSWP3,CPLHIST3HrWx,COPYALL_NPS_v1,COPYALL_NPS_CORE2_v1,WRF,WW3 CORE2_NYF run_component_datm env_run.xml Mode for data atmosphere component. The default is CORE2_NYF (CORE2 normal year forcing) is the - DATM mode used in C and G compsets. CLM_QIAN, CLMCRUNCEP and CLM1PT are + DATM mode used in C and G compsets. CLM_QIAN, CLMCRUNCEP, CLMGSWP3 and CLM1PT are modes using observational data for forcing CLM in I compsets. CORE2_NYF @@ -30,6 +30,7 @@ COPYALL_NPS_CORE2_v1 CLM_QIAN CLMCRUNCEP + CLMGSWP3 CLM1PT CPLHIST3HrWx @@ -130,16 +131,22 @@ 1 1 1 + 1 1 1895 1901 + 1901 1 2004 2005 + 2005 1 1 1 1 + 1 + 1 + 1 run_component_datm env_run.xml @@ -154,16 +161,22 @@ 1972 1948 1901 + 1901 1972 1948 1901 + 1901 1948 1972 1991 + 1991 2002 1901 1991 2002 + 1901 + 1991 + 2002 run_component_datm env_run.xml @@ -178,16 +191,22 @@ 2004 1972 1920 + 1920 2004 1972 1920 + 1920 2004 2004 2010 + 2010 2003 1920 2010 2003 + 1920 + 2010 + 2003 run_component_datm env_run.xml @@ -206,6 +225,11 @@ CRUNCEP atm input data for 2002-2003: CRUNCEP atm input data for 1901-1920: CRUNCEP atm input data for 1991-2010: + GSWP3 atm input data for 1901-1920: + GSWP3 atm input data for 1991-2010: + GSWP3 atm input data for 2002-2003: + GSWP3 atm input data for 1901-1920: + GSWP3 atm input data for 1991-2010: CPL history input data: single point tower site atm input data: COREv2 datm normal year forcing: (requires additional user-supplied data) From 983a45089f4125e844ab709379a2eeb464010b4f Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 17 Dec 2015 16:20:57 -0700 Subject: [PATCH 18/46] Work on CLMGSWP3, and remove drv_flds_in in preview_namelist --- components/data_comps/datm/bld/build-namelist | 10 ++++---- .../bld/unit_testers/build-namelist_test.pl | 24 +++++++++---------- scripts/Tools/preview_namelists | 11 +++++++++ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/components/data_comps/datm/bld/build-namelist b/components/data_comps/datm/bld/build-namelist index 7db8052cf2c..4ac12c3110d 100755 --- a/components/data_comps/datm/bld/build-namelist +++ b/components/data_comps/datm/bld/build-namelist @@ -180,10 +180,10 @@ my $cimeroot = abs_path($CIMEROOT); my $perl5lib = "$cimeroot/utils/perl5lib"; # The XML::Lite module is required to parse the XML files. -(-f "$perl5lib/XML/Lite.pm") or die <<"EOF"; -** $ProgName - Cannot find perl module \"XML/Lite.pm\" in directory - \"$perl5lib\" ** -EOF +#(-f "$perl5lib/XML/Lite.pm") or die <<"EOF"; +#** $ProgName - Cannot find perl module \"XML/Lite.pm\" in directory + #\"$perl5lib\" ** +#EOF # The Build::Config module provides utilities to access the configuration information # in the config_cache.xml file @@ -255,7 +255,7 @@ EOF my @dirs = ( "$cfgdir/..", "$perl5lib"); unshift @INC, @dirs; -require XML::Lite; +#require XML::Lite; require Build::Config; require Build::NamelistDefinition; require Build::NamelistDefaults; diff --git a/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl b/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl index 4e3299e42d9..a910b851ed4 100755 --- a/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl +++ b/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl @@ -8,6 +8,7 @@ use Test::More; use IO::File; +use Cwd qw(abs_path); ######################### @@ -70,23 +71,22 @@ sub usage { print "CASEROOT = $CASEROOT\n"; my $confdir = "$CASEROOT/Buildconf/datmconf"; -# Check that SCRIPTSROOT set so can run -if ( $ENV{'SCRIPTSROOT'} eq "" ) { - my $dir = "../../../../../scripts"; - if ( ! -d "$dir" ) { - die "SCRIPTSROOT NOT set, and scripts directory $dir does not exist\n"; +# Check that CIMEROOT set so can run +if ( $ENV{'CIMEROOT'} eq "" ) { + my $dir = abs_path("../../../../.."); + if ( ! -d "$dir/scripts" ) { + die "CIMEROOT NOT set, and scripts directory $dir/scripts does not exist\n"; } - $ENV{'SCRIPTSROOT'} = $dir; - print "SCRIPTSROOT = $ENV{'SCRIPTSROOT'}\n"; + $ENV{'CIMEROOT'} = $dir; + print "CIMEROOT = $ENV{'CIMEROOT'}\n"; } else { - if ( ! -d "$ENV{'SCRIPTSROOT'}" ) { - die "SCRIPTSROOT dir does not exist\n"; + if ( ! -d "$ENV{'CIMEROOT'}"."/scripts" ) { + die "CIMEROOT scripts dir does not exist\n"; } } # # -my $cimeroot = "$ENV{'SCRIPTSROOT'}/../"; -my $bldnml = "../build-namelist -debug -caseroot $CASEROOT -cimeroot $cimeroot"; +my $bldnml = "../build-namelist -debug -caseroot $CASEROOT -cimeroot $ENV{'CIMEROOT'}"; my $tempfile = "temp_file.txt"; if ( -f $tempfile ) { @@ -322,7 +322,7 @@ sub usage { isnt( $?, 0, "check for unresolved env variables" ); system( "/bin/rm -rf $confdir" ); # Run different DATM_MODE -foreach my $mode ( "CORE2_NYF", "CORE2_IAF", "CPLHIST3HrWx", "CLMCRUNCEP","CLMCRUNCEP_V5" ) { +foreach my $mode ( "CORE2_NYF", "CORE2_IAF", "CPLHIST3HrWx", "CLMCRUNCEP","CLMCRUNCEP_V5", "CLMGSWP3" ) { $xmlenv{'DATM_MODE'} = $mode; print "DATM_MODE = $xmlenv{'DATM_MODE'}\n"; &writeEnv( %xmlenv ); diff --git a/scripts/Tools/preview_namelists b/scripts/Tools/preview_namelists index 84b5b292fb9..42f6eb1b8ae 100755 --- a/scripts/Tools/preview_namelists +++ b/scripts/Tools/preview_namelists @@ -170,6 +170,17 @@ my %dirs = ( atm => $CONFIG_ATM_DIR, lnd => $CONFIG_LND_DIR, ice => $CONFIG_IC ocn => $CONFIG_OCN_DIR, glc => $CONFIG_GLC_DIR, wav => $CONFIG_WAV_DIR, rof => $CONFIG_ROF_DIR, drv => $CONFIG_DRV_DIR ); +my $drvfldsnl = "${RUNDIR}/drv_flds_in"; +if ( -f $drvfldsnl ) { + if ($opts{loglevel} eq "DEBUG") { + print "Remove $drvfldsnl\n"; + } + system( "rm $drvfldsnl" ); + if($? != 0){ + $logger->logdie("Removal of $drvfldsnl failed: $?"); + } +} + foreach my $model (@modelsorder) { my $comp = $models{$model}; my $file = "$dirs{$model}/buildnml"; From 1b79608dd961b6bc69380a190c8e3e2e0efefa75 Mon Sep 17 00:00:00 2001 From: Anthony Craig Date: Mon, 25 Jan 2016 11:15:29 -0800 Subject: [PATCH 19/46] Update machines files for constance. --- .../cesm/machines/config_compilers.xml | 5 ++- cime_config/cesm/machines/config_machines.xml | 41 +++++++++++++++---- cime_config/cesm/machines/config_pio.xml | 1 + 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/cime_config/cesm/machines/config_compilers.xml b/cime_config/cesm/machines/config_compilers.xml index a25fc48cb40..c9684a4766d 100644 --- a/cime_config/cesm/machines/config_compilers.xml +++ b/cime_config/cesm/machines/config_compilers.xml @@ -294,6 +294,8 @@ for mct, etc. TRUE -mkl=cluster -mkl=cluster + -mkl=cluster + -mkl=cluster -mkl=cluster -mkl=cluster -mkl=cluster @@ -475,7 +477,6 @@ for mct, etc. /glade/apps/opt/lib - netcdf @@ -722,7 +723,7 @@ for mct, etc. --host=Linux lustre -DLINUX - -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi + -L$(NETCDF_PATH)/lib -lnetcdf -lnetcdff -lpmi -L$(MKL_PATH) -lmkl_rt diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index f6ac357da59..aabf94a5b48 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -423,19 +423,20 @@ PNL Haswell cluster, OS is Linux, batch system is SLURM LINUX - pgi,intel - mvapich2,mvapich - /pic/scratch/$CCSMUSER/$CASE/run - /pic/scratch/$CCSMUSER/$CASE/bld + intel,pgi + mvapich2,openmpi,intelmpi,mvapich + /pic/scratch/$USER/$CASE/run + /pic/scratch/$USER/$CASE/bld /pic/scratch/$USER /pic/scratch/tcraig/IRESM/inputdata /pic/scratch/tcraig/IRESM/inputdata/atm/datm7 - /pic/scratch/$CCSMUSER/cases/archive/$CASE + /pic/scratch/$USER/cases/archive/$CASE UNSET /pic/scratch/tcraig/IRESM/ccsm_baselines /people/tcraig/bin/cprnc squeue sbatch + tcraig -at- ucar.edu 8 24 @@ -459,7 +460,7 @@ srun --mpi=none - -ntasks={{ num_tasks }} + --ntasks={{ num_tasks }} --cpu_bind=sockets --cpu_bind=verbose --kill-on-bad-exit @@ -467,11 +468,23 @@ srun - -ntasks={{ num_tasks }} + --ntasks={{ num_tasks }} --cpu_bind=sockets --cpu_bind=verbose --kill-on-bad-exit + + mpirun + + -n {{ num_tasks }} + + + + mpirun + + -n {{ num_tasks }} + + /share/apps/modules/Modules/3.2.10/init/perl.pm /etc/profile.d/modules.csh @@ -488,15 +501,25 @@ intel/15.0.1 - mvapich2/2.1 netcdf/4.3.2 mkl/15.0.1 pgi/14.10 - mvapich2/2.1 netcdf/4.3.2 + + mvapich2/2.1 + + + mvapich2/2.1 + + + intelmpi/5.0.1.035 + + + openmpi/1.8.3 + 64M diff --git a/cime_config/cesm/machines/config_pio.xml b/cime_config/cesm/machines/config_pio.xml index 1a3dc465b3c..2666ae8762d 100644 --- a/cime_config/cesm/machines/config_pio.xml +++ b/cime_config/cesm/machines/config_pio.xml @@ -46,6 +46,7 @@ pnetcdf netcdf netcdf + netcdf netcdf netcdf netcdf From a3e750196cb0dfa373d1f5112de317c2f3ebf2e1 Mon Sep 17 00:00:00 2001 From: apcraig Date: Fri, 29 Jan 2016 15:01:27 -0700 Subject: [PATCH 20/46] update cime for pop single column and strm4d capabilities. --- driver_cpl/shr/seq_flds_mod.F90 | 19 ++- share/csm_share/shr/shr_dmodel_mod.F90 | 193 ++++++++++++++++++++---- share/csm_share/shr/shr_ncread_mod.F90 | 193 +++++++++++++++++++++++- share/csm_share/shr/shr_scam_mod.F90 | 4 +- share/csm_share/shr/shr_strdata_mod.F90 | 158 ++++++++++++++----- share/csm_share/shr/shr_stream_mod.F90 | 36 ++++- 6 files changed, 517 insertions(+), 86 deletions(-) diff --git a/driver_cpl/shr/seq_flds_mod.F90 b/driver_cpl/shr/seq_flds_mod.F90 index e2729525427..12d831472bd 100644 --- a/driver_cpl/shr/seq_flds_mod.F90 +++ b/driver_cpl/shr/seq_flds_mod.F90 @@ -469,35 +469,42 @@ subroutine seq_flds_set(nmlfile, ID) !---------------------------------------------------------- call seq_flds_add(dom_coord,'lat') - longname = '' + longname = 'latitude' stdname = 'latitude' units = 'degrees north' attname = 'lat' call metadata_set(attname, longname, stdname, units) call seq_flds_add(dom_coord,'lon') - longname = '' + longname = 'longitude' stdname = 'longitude' units = 'degrees east' attname = 'lon' call metadata_set(attname, longname, stdname, units) + call seq_flds_add(dom_coord,'hgt') + longname = 'height' + stdname = 'height, depth, or levels' + units = 'unitless' + attname = 'hgt' + call metadata_set(attname, longname, stdname, units) + call seq_flds_add(dom_other,'area') - longname = '' - stdname = 'cell area' + longname = 'cell_area_model' + stdname = 'cell area from model' units = 'radian^2' attname = 'area' call metadata_set(attname, longname, stdname, units) call seq_flds_add(dom_other,'aream') - longname = '' + longname = 'cell_area_mapping' stdname = 'cell area from mapping file' units = 'radian^2' attname = 'aream' call metadata_set(attname, longname, stdname, units) call seq_flds_add(dom_other,'mask') - longname = '' + longname = 'mask' stdname = 'mask' units = 'unitless' attname = 'mask' diff --git a/share/csm_share/shr/shr_dmodel_mod.F90 b/share/csm_share/shr/shr_dmodel_mod.F90 index 7eefbcd39c4..d048361cd12 100644 --- a/share/csm_share/shr/shr_dmodel_mod.F90 +++ b/share/csm_share/shr/shr_dmodel_mod.F90 @@ -32,9 +32,14 @@ module shr_dmodel_mod public :: shr_dmodel_translate_list public :: shr_dmodel_rearrGGrid + interface shr_dmodel_gsmapCreate; module procedure & + shr_dmodel_gsmapCreate_gsize, & + shr_dmodel_gsmapCreate_nxnynz + end interface + interface shr_dmodel_mapSet; module procedure & +! shr_dmodel_mapSet_dest, & shr_dmodel_mapSet_global -! shr_dmodel_mapSet_dest end interface integer(IN),parameter,public :: shr_dmodel_gGridCompareXYabs = 1 ! X,Y relative error @@ -66,7 +71,8 @@ module shr_dmodel_mod !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !=============================================================================== -subroutine shr_dmodel_gsmapCreate(gsmap,gsize,compid,mpicom,decomp) +!=============================================================================== +subroutine shr_dmodel_gsmapCreate_gsize(gsmap,gsize,compid,mpicom,decomp) implicit none @@ -82,9 +88,9 @@ subroutine shr_dmodel_gsmapCreate(gsmap,gsize,compid,mpicom,decomp) integer(IN), pointer :: start(:) ! for gsmap initialization integer(IN), pointer :: length(:) ! for gsmap initialization integer(IN), pointer :: pe_loc(:) ! for gsmap initialization - character(*), parameter :: subname = '(shr_dmodel_gsmapCreate) ' - character(*), parameter :: F00 = "('(shr_dmodel_gsmapCreate) ',8a)" - character(*), parameter :: F01 = "('(shr_dmodel_gsmapCreate) ',a,5i8)" + character(*), parameter :: subname = '(shr_dmodel_gsmapCreate_gsize) ' + character(*), parameter :: F00 = "('(shr_dmodel_gsmapCreate_gsize) ',8a)" + character(*), parameter :: F01 = "('(shr_dmodel_gsmapCreate_gsize) ',a,5i8)" ! --------------------------------------------- @@ -116,18 +122,92 @@ subroutine shr_dmodel_gsmapCreate(gsmap,gsize,compid,mpicom,decomp) deallocate(start,length,pe_loc) endif -end subroutine shr_dmodel_gsmapCreate +end subroutine shr_dmodel_gsmapCreate_gsize +!=============================================================================== +subroutine shr_dmodel_gsmapCreate_nxnynz(gsmap,nxg,nyg,nzg,compid,mpicom,decomp) + + implicit none + + type(mct_gsMap), intent(inout) :: gsmap + integer(IN) , intent(in) :: nxg,nyg,nzg + integer(IN) , intent(in) :: compid + integer(IN) , intent(in) :: mpicom + character(len=*),intent(in) :: decomp + + ! local + + integer(IN) :: n,nz,nb,npes,ierr,gsize,dsize,ngseg,lnzg + integer(IN), pointer :: start(:) ! for gsmap initialization + integer(IN), pointer :: length(:) ! for gsmap initialization + integer(IN), pointer :: pe_loc(:) ! for gsmap initialization + character(*), parameter :: subname = '(shr_dmodel_gsmapCreate_nxnynz) ' + character(*), parameter :: F00 = "('(shr_dmodel_gsmapCreate_nxnynz) ',8a)" + character(*), parameter :: F01 = "('(shr_dmodel_gsmapCreate_nxnynz) ',a,5i8)" + + ! --------------------------------------------- + + gsize = abs(nxg*nyg*nzg) + dsize = nxg*nyg + lnzg = 1 + if (nzg > 1) lnzg = nzg ! check for 3d + + if (gsize > 0) then + call mpi_comm_size(mpicom,npes,ierr) + + !--- 1d decomp of 2d grid plus 3rd dim if exists --- + if (trim(decomp) == '2d1d') then + ngseg = npes*lnzg + allocate(start(ngseg),length(ngseg),pe_loc(ngseg)) + start = 0 + length = 0 + pe_loc = 0 + do n = 1,npes + length(n) = dsize/npes + if (n <= mod(dsize,npes)) length(n) = length(n) + 1 + if (n == 1) then + start(n) = 1 + else + start(n) = start(n-1) + length(n-1) + endif + pe_loc(n) = n-1 + do nz = 2,lnzg + nb = (nz-1)*npes + n + start(nb) = start(n) + (nz-1)*dsize + length(nb) = length(n) + pe_loc(nb) = pe_loc(n) + enddo + enddo + + !--- all data on root --- + elseif (trim(decomp) == 'root') then + ngseg = 1 + allocate(start(ngseg),length(ngseg),pe_loc(ngseg)) + start(1) = 1 + length(1) = gsize + pe_loc(1) = 0 + + else + write(logunit,F00) ' ERROR: decomp not allowed, ',trim(decomp) + call shr_sys_abort(subname//' ERROR decomp') + endif + + call mct_gsMap_init( gsMap, COMPID, ngseg, gsize, start, length, pe_loc) + deallocate(start,length,pe_loc) + endif + +end subroutine shr_dmodel_gsmapCreate_nxnynz !=============================================================================== -subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpicom, & - decomp, lonname, latname, maskname, areaname, fracname, readfrac, & +subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, nzgo, filename, compid, mpicom, & + decomp, lonname, latname, hgtname, maskname, areaname, fracname, readfrac, & scmmode, scmlon, scmlat) use seq_flds_mod, only : seq_flds_dom_coord, seq_flds_dom_other use shr_file_mod, only : shr_file_noprefix, shr_file_queryprefix, shr_file_get use shr_string_mod, only : shr_string_lastindex use shr_ncread_mod, only : shr_ncread_domain, shr_ncread_vardimsizes, & - shr_ncread_varexists, shr_ncread_vardimnum + shr_ncread_varexists, shr_ncread_vardimnum, & + shr_ncread_field4dG implicit none !----- arguments ----- @@ -135,12 +215,14 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic type(mct_gsMap), intent(inout) :: gsMap integer(IN) , intent(out) :: nxgo integer(IN) , intent(out) :: nygo + integer(IN) , intent(out) :: nzgo character(len=*),intent(in) :: filename integer(IN) , intent(in) :: compid integer(IN) , intent(in) :: mpicom character(len=*),optional,intent(in) :: decomp ! decomp strategy for gsmap character(len=*),optional,intent(in) :: lonname ! name of lon variable in file character(len=*),optional,intent(in) :: latname ! name of lat variable in file + character(len=*),optional,intent(in) :: hgtname ! name of hgt variable in file character(len=*),optional,intent(in) :: maskname ! name of mask variable in file character(len=*),optional,intent(in) :: areaname ! name of area variable in file character(len=*),optional,intent(in) :: fracname ! name of frac variable in file @@ -161,16 +243,17 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic character(CL) :: localFn ! file name to be opened (possibly a local copy) character(CS) :: prefix ! file prefix character(CS) :: ldecomp ! decomp strategy - character(CS) :: llatname ! name of lat variable character(CS) :: llonname ! name of lon variable + character(CS) :: llatname ! name of lat variable + character(CS) :: lhgtname ! name of hgt variable character(CS) :: lmaskname ! name of mask variable character(CS) :: lareaname ! name of area variable character(CS) :: lfracname ! name of area variable logical :: lreadfrac ! read fraction logical :: maskexists ! is mask on dataset - integer(IN) :: nxg,nyg ! size of input fields + integer(IN) :: nxg,nyg,nzg ! size of input fields integer(IN) :: ndims ! number of dims - integer(IN) :: nlon,nlat,narea,nmask,nfrac + integer(IN) :: nlon,nlat,narea,nmask,nfrac,nhgt logical :: lscmmode ! local scm mode real(R8) :: dist,mind ! scmmode point search integer(IN) :: ni,nj ! scmmode point search @@ -181,6 +264,8 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic integer(IN),allocatable :: mask(:,:) ! temp array for domain mask info real (R8),allocatable :: area(:,:) ! temp array for domain area info real (R8),allocatable :: frac(:,:) ! temp array for domain frac info + real (R8),allocatable :: hgt(:) ! temp array for domain height info + real (R8),allocatable :: a4d(:,:,:,:) ! temp array for reading generic stuff integer(IN), pointer :: idata(:) ! temporary type(mct_ggrid) :: gGridRoot ! global mct ggrid @@ -237,9 +322,10 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic endif lreadfrac = .false. - ldecomp = "1d" + ldecomp = "2d1d" llonname = "xc" ! default values / standard data model domain file format llatname = "yc" + lhgtname = "hgt" lmaskname = "mask" lareaname = "area" lfracname = "frac" @@ -247,6 +333,7 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic if (present(readfrac)) lreadfrac = readfrac if (present( lonname)) llonname = lonname if (present( latname)) llatname = latname + if (present( hgtname)) lhgtname = hgtname if (present(maskname)) lmaskname = maskname if (present(areaname)) lareaname = areaname if (present(fracname)) lfracname = fracname @@ -268,21 +355,29 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic call shr_ncread_varDimSizes(localFn,llonName,nxg,nyg) endif endif + if (shr_ncread_varexists(localFn,lhgtName)) then + call shr_ncread_varDimSizes(localFn,lhgtname,nzg) + else + nzg = -1 + endif endif call shr_mpi_bcast(nxg,mpicom) call shr_mpi_bcast(nyg,mpicom) + call shr_mpi_bcast(nzg,mpicom) if (lscmmode) then nxgo = 1 nygo = 1 + nzgo = -1 gsize = 1 else nxgo = nxg nygo = nyg - gsize = nxg*nyg + nzgo = nzg + gsize = abs(nxg*nyg*nzg) if (gsize < 1) return endif - call shr_dmodel_gsmapCreate(gsMap,gsize,compid,mpicom,trim(ldecomp)) + call shr_dmodel_gsmapCreate(gsMap,nxgo,nygo,nzgo,compid,mpicom,trim(ldecomp)) lsize = mct_gsMap_lsize(gsMap, mpicom) call mct_gGrid_init( GGrid=gGrid, CoordChars=trim(seq_flds_dom_coord), & OtherChars=trim(seq_flds_dom_other), lsize=lsize ) @@ -306,6 +401,7 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic allocate(area(nxg,nyg)) allocate(mask(nxg,nyg)) allocate(frac(nxg,nyg)) + allocate(hgt(abs(nzg))) if (.not.maskexists) then call shr_ncread_domain(localFn,llonName,lon,llatName,lat) @@ -327,6 +423,15 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic endif endif + if (nzg > 1) then + allocate(a4d(nzg,1,1,1)) + call shr_ncread_field4dG(localFn,hgtName,rfld=a4d) + hgt(:) = a4d(:,1,1,1) + deallocate(a4d) + else + hgt = 1 + endif + call mct_gGrid_init(gGridRoot,gGrid,gsize) ! initialize gGridRoot to avoid errors when using strict compiler checks @@ -337,6 +442,7 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic narea = mct_aVect_indexRA(gGridRoot%data,'area') nmask = mct_aVect_indexRA(gGridRoot%data,'mask') nfrac = mct_aVect_indexRA(gGridRoot%data,'frac') + nhgt = mct_aVect_indexRA(gGridRoot%data,'hgt') if (lscmmode) then !--- assumes regular 2d grid for compatability with shr_scam_getCloseLatLon --- @@ -373,8 +479,10 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic gGridRoot%data%rAttr(narea,n) = area(i,j) gGridRoot%data%rAttr(nmask,n) = real(mask(i,j),R8) gGridRoot%data%rAttr(nfrac,n) = frac(i,j) + gGridRoot%data%rAttr(nhgt, n) = 1 else - n=0 + n=0 + do k=1,abs(nzg) do j=1,nyg do i=1,nxg n=n+1 @@ -383,14 +491,20 @@ subroutine shr_dmodel_readgrid( gGrid, gsMap, nxgo, nygo, filename, compid, mpic gGridRoot%data%rAttr(narea,n) = area(i,j) gGridRoot%data%rAttr(nmask,n) = real(mask(i,j),R8) gGridRoot%data%rAttr(nfrac,n) = frac(i,j) + gGridRoot%data%rAttr(nhgt ,n) = hgt(k) + enddo enddo enddo endif + endif + + if (my_task == master_task) then deallocate(lon) deallocate(lat) deallocate(area) deallocate(mask) deallocate(frac) + deallocate(hgt) endif call mct_gGrid_scatter(gGridRoot, gGrid, gsMap, master_task, mpicom) @@ -575,7 +689,8 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs use shr_file_mod, only : shr_file_noprefix, shr_file_queryprefix, shr_file_get use shr_stream_mod - use shr_ncread_mod + use shr_ncread_mod, only: shr_ncread_open, shr_ncread_close, shr_ncread_varDimSizes, & + shr_ncread_tField implicit none !----- arguments ----- @@ -597,11 +712,13 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs integer(IN) :: ierr logical :: localCopy,fileexists type(mct_avect) :: avG - integer(IN) :: gsize,nx,ny + integer(IN) :: gsize,nx,ny,nz integer(IN) :: k integer(IN) :: fid integer(IN) :: rCode ! return code - real(R8),allocatable :: data(:,:) + real(R8),allocatable :: data2d(:,:) + real(R8),allocatable :: data3d(:,:,:) + logical :: d3dflag character(CL) :: fileName character(CL) :: sfldName type(mct_avect) :: avtmp @@ -656,21 +773,35 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs call t_startf(trim(lstr)//'_readcdf') if (my_task == master_task) then - call shr_ncread_varDimSizes(trim(fileName),trim(sfldName),nx,ny) - if (gsize /= nx*ny) then - write(logunit,F01) "ERROR in data sizes ",nx,ny,gsize + call shr_ncread_varDimSizes(trim(fileName),trim(sfldName),nx,ny,nz) + if (gsize == nx*ny) then + d3dflag = .false. + allocate(data2d(nx,ny)) + elseif (gsize == nx*ny*nz) then + d3dflag = .true. + allocate(data3d(nx,ny,nz)) + else + write(logunit,F01) "ERROR in data sizes ",nx,ny,nz,gsize call shr_sys_abort(subname//"ERROR in data sizes") endif call mct_aVect_init(avG,av,gsize) - allocate(data(nx,ny)) call shr_ncread_open(trim(fileName),fid,rCode) do k = 1,mct_aVect_nRAttr(av) call shr_stream_getFileFieldName(stream,k,sfldName) - call shr_ncread_tField(fileName,nt,sfldName,data,fidi=fid,rc=rCode) - avG%rAttr(k,:) = reshape(data, (/gsize/)) + if (d3dflag) then + call shr_ncread_tField(fileName,nt,sfldName,data3d,fidi=fid,rc=rCode) + avG%rAttr(k,:) = reshape(data3d, (/gsize/)) + else + call shr_ncread_tField(fileName,nt,sfldName,data2d,fidi=fid,rc=rCode) + avG%rAttr(k,:) = reshape(data2d, (/gsize/)) + endif enddo call shr_ncread_close(fid,rCode) - deallocate(data) + if (d3dflag) then + deallocate(data3d) + else + deallocate(data2d) + endif endif call t_stopf(trim(lstr)//'_readcdf') call t_barrierf(trim(lstr)//'_scatter'//'_BARRIER',mpicom) @@ -693,11 +824,12 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs rcode = pio_inq_varndims(pioid, varid, ndims) allocate(dimid(ndims)) rcode = pio_inq_vardimid(pioid, varid, dimid(1:ndims)) - rcode = pio_inq_dimlen(pioid, dimid(1), nx) - rcode = pio_inq_dimlen(pioid, dimid(2), ny) + if (ndims >= 1) rcode = pio_inq_dimlen(pioid, dimid(1), nx) + if (ndims >= 2) rcode = pio_inq_dimlen(pioid, dimid(2), ny) + if (ndims >= 3) rcode = pio_inq_dimlen(pioid, dimid(3), nz) deallocate(dimid) - if (gsize /= nx*ny) then - write(logunit,F01) "ERROR in data sizes ",nx,ny,gsize + if (gsize /= nx*ny .and. gsize /= nx*ny*nz) then + write(logunit,F01) "ERROR in data sizes ",nx,ny,nz,gsize call shr_sys_abort(subname//"ERROR in data sizes") endif @@ -709,6 +841,7 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs rcode = pio_inq_varid(pioid,trim(sfldName),varid) frame = nt call pio_setframe(pioid,varid,frame) + write(logunit,*) subname,' read ',trim(sfldName),k call pio_read_darray(pioid,varid,pio_iodesc,av%rattr(k,:),rcode) enddo diff --git a/share/csm_share/shr/shr_ncread_mod.F90 b/share/csm_share/shr/shr_ncread_mod.F90 index 94a0a7b7556..f080f90c6cb 100644 --- a/share/csm_share/shr/shr_ncread_mod.F90 +++ b/share/csm_share/shr/shr_ncread_mod.F90 @@ -84,8 +84,10 @@ module shr_ncread_mod end interface interface shr_ncread_tField ; module procedure & + shr_ncread_tField3dR8, & shr_ncread_tField2dR8, & shr_ncread_tField1dR8, & + shr_ncread_tField3dIN, & shr_ncread_tField2dIN, & shr_ncread_tField1dIN end interface @@ -200,7 +202,7 @@ subroutine shr_ncread_varDimNum(fileName, varName, ns, rc) !--- read variable info --- rcode = nf90_inq_varid(fid,trim(varName),vid) - call shr_ncread_handleErr(rCode, subName//" ERROR inq varid") + call shr_ncread_handleErr(rCode, subName//" ERROR inq varid: "//trim(varName)) rcode = nf90_inquire_variable(fid,vid,ndims=ns) call shr_ncread_handleErr(rCode, subName//" ERROR inq var") if (debug > 1 .and. s_loglev > 0) write(s_logunit,F01) trim(varName)//' has dims = ',ns @@ -309,7 +311,7 @@ subroutine shr_ncread_varDimSizeID(fileName, varName, dnum, ns, rc) call shr_ncread_open(fileName,fid,rCode) rCode = nf90_inq_varid(fid,trim(varName),vid) - call shr_ncread_handleErr(rCode,subName//' ERROR inq varid vid') + call shr_ncread_handleErr(rCode,subName//' ERROR inq varid: '//trim(varName)) rCode = nf90_inquire_variable(fid,vid,ndims=ndims) call shr_ncread_handleErr(rCode,subName//' ERROR inquire variable ndims') allocate(dids(ndims)) @@ -382,7 +384,7 @@ subroutine shr_ncread_varDimSizes(fileName, varName, n1, n2, n3, n4, n5, n6, rc) call shr_ncread_open(fileName,fid,rCode) rCode = nf90_inq_varid(fid,trim(varName),vid) - call shr_ncread_handleErr(rCode,subName//' ERROR inq varid vid') + call shr_ncread_handleErr(rCode,subName//' ERROR inq varid: '//trim(varName)) rCode = nf90_inquire_variable(fid,vid,ndims=ndims) call shr_ncread_handleErr(rCode,subName//' ERROR inquire variable ndims') allocate(dids(ndims)) @@ -702,6 +704,98 @@ end subroutine shr_ncread_domain !=============================================================================== !BOP =========================================================================== ! +! !IROUTINE: shr_ncread_tField3dR8 -- read in field data from a file +! +! !DESCRIPTION: +! Read in field data from a netcdf file. This is a special routine +! built specificallly for CCSM. The idea is to read a snapshot of +! (possibly) time-varying data from a netcdf file. The array is a +! 3d real*8 field in this case. Inputs are filename, timeslice +! (integer), and variable name. Optional inputs include the +! time dimension name and the 2 dimension names for the array. +! If dim1 is sent as an optional argument, dim2 must also be sent. +! Otherwise, the time dimension is assumed to be the third +! dimension and the first 2 dimensions are associated with the +! 3d array. +! +! \newline +! General Usage: +! call shr_ncread_tField('myfile',6,'sst',a3d) +! \newline +! !REVISION HISTORY: +! 2005-Apr-28 - T. Craig - first version +! +! !INTERFACE: ------------------------------------------------------------------ + +subroutine shr_ncread_tField3dR8(fn, tIndex, fldName, fld, dim1, dim2, dim3, tName, fidi, rc) + + implicit none + +! !INPUT/OUTPUT PARAMETERS: + + character(*) ,intent(in) :: fn ! nc file name + integer(SHR_KIND_IN),intent(in) :: tIndex ! time-coord index + character(*) ,intent(in) :: fldName ! name of field + real(SHR_KIND_R8) ,intent(out) :: fld(:,:,:) ! field array + character(*) ,intent(in) ,optional :: dim1 ! name of dim1 in fld + character(*) ,intent(in) ,optional :: dim2 ! name of dim2 in fld + character(*) ,intent(in) ,optional :: dim3 ! name of dim3 in fld + character(*) ,intent(in) ,optional :: tName ! name of tIndex dim + integer(SHR_KIND_IN),intent(in) ,optional :: fidi ! file id + integer(SHR_KIND_IN),intent(out),optional :: rc ! return code + +!EOP + + !----- local ----- + real(SHR_KIND_R8),allocatable :: lfld(:,:,:,:) ! local 4d array + integer(SHR_KIND_IN) :: rCode ! error code + + !----- formats ----- + character(*),parameter :: subName = "(shr_ncread_tField3dR8)" + character(*),parameter :: F00 = "('(shr_ncread_tField3dR8) ',4a)" + +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + allocate(lfld(size(fld,1),size(fld,2),size(fld,3),1)) + + if (present(dim1).and.present(dim2).and.present(dim3).and.present(tName)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + elseif (present(dim1).and.present(dim2).and.present(dim3)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + elseif (present(tName)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4=tName,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + elseif (.not.present(dim1).and..not.present(dim2).and..not.present(dim3).and..not.present(tName)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,rfld=lfld,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + else + call shr_ncread_abort(subName//' ERROR argument combination not supported') + endif + + fld(:,:,:) = lfld(:,:,:,1) + deallocate(lfld) + + if (present(rc)) rc = rCode + +end subroutine shr_ncread_tField3dR8 +!=============================================================================== +!BOP =========================================================================== +! ! !IROUTINE: shr_ncread_tField2dR8 -- read in field data from a file ! ! !DESCRIPTION: @@ -882,6 +976,99 @@ end subroutine shr_ncread_tField1dR8 !=============================================================================== !BOP =========================================================================== ! +! !IROUTINE: shr_ncread_tField3dIN -- read in field data from a file +! +! !DESCRIPTION: +! Read in field data from a netcdf file. This is a special routine +! built specificallly for CCSM. The idea is to read a snapshot of +! (possibly) time-varying data from a netcdf file. The array is a +! 3d integer field in this case. Inputs are filename, timeslice +! (integer), and variable name. Optional inputs include the +! time dimension name and the 2 dimension names for the array. +! If dim1 is sent as an optional argument, dim2 must also be sent. +! Otherwise, the time dimension is assumed to be the third +! dimension and the first 2 dimensions are associated with the +! 3d array. +! +! \newline +! General Usage: +! call shr_ncread_tField('myfile',1,'index',i3d) +! \newline +! !REVISION HISTORY: +! 2005-Apr-28 - T. Craig - first version +! +! !INTERFACE: ------------------------------------------------------------------ + +subroutine shr_ncread_tField3dIN(fn, tIndex, fldName, fld, dim1, dim2, dim3, tName, fidi, rc) + + implicit none + +! !INPUT/OUTPUT PARAMETERS: + + character(*) ,intent(in) :: fn ! nc file name + integer(SHR_KIND_IN),intent(in) :: tIndex ! time-coord index + character(*) ,intent(in) :: fldName ! name of field + integer(SHR_KIND_IN),intent(out) :: fld(:,:,:) ! field array + character(*) ,intent(in) ,optional :: dim1 ! name of dim1 in fld + character(*) ,intent(in) ,optional :: dim2 ! name of dim2 in fld + character(*) ,intent(in) ,optional :: dim3 ! name of dim3 in fld + character(*) ,intent(in) ,optional :: tName ! name of tIndex dim + integer(SHR_KIND_IN),intent(in) ,optional :: fidi ! file id + integer(SHR_KIND_IN),intent(out),optional :: rc ! return code + +!EOP + + !----- local ----- + integer(SHR_KIND_IN),allocatable :: lfld(:,:,:,:) ! local 4d array + integer(SHR_KIND_IN) :: rCode ! error code + + !----- formats ----- + character(*),parameter :: subName = "(shr_ncread_tField3dIN)" + character(*),parameter :: F00 = "('(shr_ncread_tField3dIN) ',4a)" + +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + + allocate(lfld(size(fld,1),size(fld,2),size(fld,3),1)) + + if (present(dim1).and.present(dim2).and.present(dim3).and.present(tName)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + elseif (present(dim1).and.present(dim2).and.present(dim3)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim1=dim1,dim2=dim2,dim3=dim3,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + elseif (present(tName)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4=tName,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4=tName,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + elseif (.not.present(dim1).and..not.present(dim2).and..not.present(dim3).and..not.present(tName)) then + if (.not.present(fidi)) then + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4i=tIndex,rc=rCode) + else + call shr_ncread_field4dG(fn,fldName,ifld=lfld,dim4i=tIndex,fidi=fidi,rc=rCode) + endif + else + call shr_ncread_abort(subName//' ERROR argument combination not supported') + endif + + fld(:,:,:) = lfld(:,:,:,1) + deallocate(lfld) + + if (present(rc)) rc = rCode + +end subroutine shr_ncread_tField3dIN +!=============================================================================== +!BOP =========================================================================== +! ! !IROUTINE: shr_ncread_tField2dIN -- read in field data from a file ! ! !DESCRIPTION: diff --git a/share/csm_share/shr/shr_scam_mod.F90 b/share/csm_share/shr/shr_scam_mod.F90 index b7f96b86799..3c162f5e345 100644 --- a/share/csm_share/shr/shr_scam_mod.F90 +++ b/share/csm_share/shr/shr_scam_mod.F90 @@ -687,8 +687,8 @@ subroutine shr_scam_checkSurface(scmlon, scmlat, ocn_compid, ocn_mpicom, & close( unitn ) call shr_file_freeUnit(unitn) call shr_strdata_readnml(SCAMSDAT,ocn_in) - call shr_dmodel_readgrid(SCAMSDAT%grid,SCAMSDAT%gsmap,SCAMSDAT%nxg,SCAMSDAT%nyg, & - SCAMSDAT%domainfile, ocn_compid, ocn_mpicom, '1d', readfrac=.true., & + call shr_dmodel_readgrid(SCAMSDAT%grid,SCAMSDAT%gsmap,SCAMSDAT%nxg,SCAMSDAT%nyg,SCAMSDAT%nzg, & + SCAMSDAT%domainfile, ocn_compid, ocn_mpicom, '2d1d', readfrac=.true., & scmmode=.true.,scmlon=scmlon,scmlat=scmlat) nfrac = mct_aVect_indexRA(SCAMSDAT%grid%data,'frac') diff --git a/share/csm_share/shr/shr_strdata_mod.F90 b/share/csm_share/shr/shr_strdata_mod.F90 index ded8b0ab6a3..2b4c0852771 100644 --- a/share/csm_share/shr/shr_strdata_mod.F90 +++ b/share/csm_share/shr/shr_strdata_mod.F90 @@ -70,6 +70,7 @@ module shr_strdata_mod ! !PRIVATE: + integer(SHR_KIND_IN) :: debug = 0 ! local debug flag integer(IN),parameter :: nStrMax = 30 integer(IN),parameter :: nVecMax = 30 character(len=*),public,parameter :: shr_strdata_nullstr = 'null' @@ -103,6 +104,7 @@ module shr_strdata_mod ! --- internal, public --- integer(IN) :: nxg integer(IN) :: nyg + integer(IN) :: nzg integer(IN) :: lsize type(mct_gsmap) :: gsmap type(mct_ggrid) :: grid @@ -114,16 +116,17 @@ module shr_strdata_mod integer(IN) :: nstreams ! number of streams integer(IN) :: strnxg(nStrMax) integer(IN) :: strnyg(nStrMax) + integer(IN) :: strnzg(nStrMax) logical :: dofill(nStrMax) logical :: domaps(nStrMax) integer(IN) :: lsizeR(nStrMax) type(mct_gsmap) :: gsmapR(nStrMax) type(mct_rearr) :: rearrR(nStrMax) type(mct_ggrid) :: gridR(nStrMax) - type(mct_avect) :: avRLB(nStrMax) - type(mct_avect) :: avRUB(nStrMax) - type(mct_avect) :: avFUB(nStrMax) - type(mct_avect) :: avFLB(nStrMax) + type(mct_avect) :: avRLB(nStrMax) ! Read attrvect + type(mct_avect) :: avRUB(nStrMax) ! Read attrvect + type(mct_avect) :: avFUB(nStrMax) ! Final attrvect + type(mct_avect) :: avFLB(nStrMax) ! Final attrvect type(mct_avect) :: avCoszen(nStrMax) ! data assocaited with coszen time interp type(mct_sMatP) :: sMatPf(nStrMax) type(mct_sMatP) :: sMatPs(nStrMax) @@ -147,7 +150,7 @@ module shr_strdata_mod !=============================================================================== subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & - gsmap,ggrid,nxg,nyg,calendar) + gsmap,ggrid,nxg,nyg,nzg,calendar) implicit none @@ -162,6 +165,7 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & type(mct_ggrid) ,intent(in),optional :: ggrid integer(IN) ,intent(in),optional :: nxg integer(IN) ,intent(in),optional :: nyg + integer(IN) ,intent(in),optional :: nzg character(len=*) ,intent(in),optional :: calendar integer(IN) :: n,m,k ! generic index @@ -174,6 +178,7 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & character(CS) :: timeName ! domain file: time variable name character(CS) :: lonName ! domain file: lon variable name character(CS) :: latName ! domain file: lat variable name + character(CS) :: hgtName ! domain file: hgt variable name character(CS) :: maskName ! domain file: mask variable name character(CS) :: areaName ! domain file: area variable name character(CS) :: uname ! u vector field name @@ -230,12 +235,15 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & if (present(nyg)) then n = n + 1 endif + if (present(nzg)) then + n = n + 1 + endif - if ( n == 0 .or. n == 4) then + if ( n == 0 .or. n == 5) then ! either all set or none set, this is OK else - write(logunit,*) subname,' ERROR: gsmap, ggrid, nxg, and nyg must be specified together' - call shr_sys_abort(subname//' ERROR: gsmap, ggrid, nxg, nyg set together') + write(logunit,*) subname,' ERROR: gsmap, ggrid, nxg, nyg and nzg must be specified together' + call shr_sys_abort(subname//' ERROR: gsmap, ggrid, nxg, nyg, nzg set together') endif lscmmode = .false. @@ -260,27 +268,41 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & ! --- initialize streams and stream domains --- - do n = 1,SDAT%nstreams if (my_task == master_task) then call shr_stream_getDomainInfo(SDAT%stream(n),filePath,fileName,timeName,lonName, & - latName,maskName,areaName) + latName,hgtName,maskName,areaName) call shr_stream_getFile(filePath,fileName) - endif - call shr_mpi_bcast(fileName,mpicom) - call shr_mpi_bcast(lonName,mpicom) - call shr_mpi_bcast(latName,mpicom) - call shr_mpi_bcast(maskName,mpicom) - call shr_mpi_bcast(areaName,mpicom) - call shr_dmodel_readgrid(SDAT%gridR(n),SDAT%gsmapR(n),SDAT%strnxg(n),SDAT%strnyg(n), & - fileName, compid, mpicom, '1d', lonName, latName, maskName, areaName) - SDAT%lsizeR(n) = mct_gsmap_lsize(SDAT%gsmapR(n),mpicom) - call mct_gsmap_OrderedPoints(SDAT%gsmapR(n), my_task, dof) - call pio_initdecomp(SDAT%pio_subsystem, pio_double, & - (/SDAT%strnxg(n),SDAT%strnyg(n)/), dof, SDAT%pio_iodesc(n)) - deallocate(dof) - - call shr_mpi_bcast(SDAT%stream(n)%calendar,mpicom) + write(logunit,*) subname,' stream ',n + write(logunit,*) subname,' filePath = ',n,trim(filePath) + write(logunit,*) subname,' fileName = ',n,trim(fileName) + write(logunit,*) subname,' timeName = ',n,trim(timeName) + write(logunit,*) subname,' lonName = ',n,trim(lonName) + write(logunit,*) subname,' latName = ',n,trim(latName) + write(logunit,*) subname,' hgtName = ',n,trim(hgtName) + write(logunit,*) subname,' maskName = ',n,trim(maskName) + write(logunit,*) subname,' areaName = ',n,trim(areaName) + endif + call shr_mpi_bcast(fileName,mpicom) + call shr_mpi_bcast(lonName,mpicom) + call shr_mpi_bcast(latName,mpicom) + call shr_mpi_bcast(hgtName,mpicom) + call shr_mpi_bcast(maskName,mpicom) + call shr_mpi_bcast(areaName,mpicom) + call shr_dmodel_readgrid(SDAT%gridR(n),SDAT%gsmapR(n),SDAT%strnxg(n),SDAT%strnyg(n),SDAT%strnzg(n), & + fileName, compid, mpicom, '2d1d', lonName, latName, hgtName, maskName, areaName) + SDAT%lsizeR(n) = mct_gsmap_lsize(SDAT%gsmapR(n),mpicom) + call mct_gsmap_OrderedPoints(SDAT%gsmapR(n), my_task, dof) + if (SDAT%strnzg(n) <= 0) then + call pio_initdecomp(SDAT%pio_subsystem, pio_double, & + (/SDAT%strnxg(n),SDAT%strnyg(n)/), dof, SDAT%pio_iodesc(n)) + else + call pio_initdecomp(SDAT%pio_subsystem, pio_double, & + (/SDAT%strnxg(n),SDAT%strnyg(n),SDAT%strnzg(n)/), dof, SDAT%pio_iodesc(n)) + endif + deallocate(dof) + + call shr_mpi_bcast(SDAT%stream(n)%calendar,mpicom) enddo ! --- initialize model domain --- @@ -288,6 +310,7 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & if (present(gsmap)) then SDAT%nxg = nxg SDAT%nyg = nyg + SDAT%nzg = nzg lsize = mct_gsmap_lsize(gsmap,mpicom) call mct_gsmap_Copy(gsmap,SDAT%gsmap) call mct_ggrid_init(SDAT%grid, ggrid, lsize) @@ -297,31 +320,32 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & if (SDAT%nstreams > 0) then if (my_task == master_task) then call shr_stream_getDomainInfo(SDAT%stream(1),filePath,fileName,timeName,lonName, & - latName,maskName,areaName) + latName,hgtName,maskName,areaName) call shr_stream_getFile(filePath,fileName) endif call shr_mpi_bcast(fileName,mpicom) call shr_mpi_bcast(lonName,mpicom) call shr_mpi_bcast(latName,mpicom) + call shr_mpi_bcast(hgtName,mpicom) call shr_mpi_bcast(maskName,mpicom) call shr_mpi_bcast(areaName,mpicom) if (lscmmode) then - call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg, & - fileName, compid, mpicom, '1d', lonName, latName, maskName, areaName, & + call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg,SDAT%nzg, & + fileName, compid, mpicom, '2d1d', lonName, latName, hgtName, maskName, areaName, & scmmode=lscmmode,scmlon=scmlon,scmlat=scmlat) else - call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg, & - fileName, compid, mpicom, '1d', lonName, latName, maskName, areaName) + call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg,SDAT%nzg, & + fileName, compid, mpicom, '2d1d', lonName, latName, hgtName, maskName, areaName) endif endif else if (lscmmode) then - call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg, & - SDAT%domainfile, compid, mpicom, '1d', readfrac=.true., & + call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg,SDAT%nzg, & + SDAT%domainfile, compid, mpicom, '2d1d', readfrac=.true., & scmmode=lscmmode,scmlon=scmlon,scmlat=scmlat) else - call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg, & - SDAT%domainfile, compid, mpicom, '1d', readfrac=.true.) + call shr_dmodel_readgrid(SDAT%grid,SDAT%gsmap,SDAT%nxg,SDAT%nyg,SDAT%nzg, & + SDAT%domainfile, compid, mpicom, '2d1d', readfrac=.true.) endif endif endif @@ -349,6 +373,10 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & endif if (SDAT%dofill(n)) then + if (SDAT%strnzg(n) > 1) then + write(logunit,*) trim(subname),' do fill called with 3d data, not allowed' + call shr_sys_abort(subname//': do fill called with 3d data, not allowed') + endif if (trim(SDAT%fillread(n)) == trim(shr_strdata_unset)) then if (my_task == master_task) then write(logunit,F00) ' calling shr_dmodel_mapSet for fill' @@ -378,7 +406,12 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & call mct_sMat_Clean(sMati) endif endif + if (SDAT%domaps(n)) then + if (SDAT%strnzg(n) > 1) then + write(logunit,*) trim(subname),' do maps called with 3d data, not allowed' + call shr_sys_abort(subname//': do maps called with 3d data, not allowed') + endif if (trim(SDAT%mapread(n)) == trim(shr_strdata_unset)) then if (my_task == master_task) then write(logunit,F00) ' calling shr_dmodel_mapSet for remap' @@ -424,6 +457,7 @@ subroutine shr_strdata_init(SDAT,mpicom,compid,name,scmmode,scmlon,scmlat, & call mct_aVect_init(SDAT%avFUB(n),rlist=fldList,lsize=SDAT%lsize) call mct_aVect_init(SDAT%avRLB(n),rlist=fldList,lsize=SDAT%lsizeR(n)) call mct_aVect_init(SDAT%avRUB(n),rlist=fldList,lsize=SDAT%lsizeR(n)) + write(logunit,*) 'tcx fldlist = ',n,trim(fldlist),SDAT%lsize,SDAT%lsizeR(n) if (trim(SDAT%tintalgo(n)) == 'coszen') then call mct_aVect_init(SDAT%avCoszen(n),rlist="tavCosz",lsize=SDAT%lsize) endif @@ -635,7 +669,18 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) SDAT%avRLB(n),SDAT%ymdLB(n),SDAT%todLB(n), & SDAT%avRUB(n),SDAT%ymdUB(n),SDAT%todUB(n),newData(n), & istr=trim(lstr)//'_readLBUB') + + if (debug > 0) then + write(logunit,*) trim(subname),' newData flag = ',n,newData(n) + write(logunit,*) trim(subname),' LB ymd,tod = ',n,SDAT%ymdLB(n),SDAT%todLB(n) + write(logunit,*) trim(subname),' UB ymd,tod = ',n,SDAT%ymdUB(n),SDAT%todUB(n) + endif + if (newData(n)) then + if (debug > 0) then + write(logunit,*) trim(subname),' newData RLB = ',n,minval(SDAT%avRLB(n)%rAttr),maxval(SDAT%avRLB(n)%rAttr),sum(SDAT%avRLB(n)%rAttr) + write(logunit,*) trim(subname),' newData RUB = ',n,minval(SDAT%avRUB(n)%rAttr),maxval(SDAT%avRUB(n)%rAttr),sum(SDAT%avRUB(n)%rAttr) + endif call shr_cal_date2ymd(SDAT%ymdLB(n),year,month,day) call shr_cal_timeSet(timeLB,SDAT%ymdLB(n),0,SDAT%stream(n)%calendar) call shr_cal_timeSet(timeUB,SDAT%ymdUB(n),0,SDAT%stream(n)%calendar) @@ -682,6 +727,10 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) call t_stopf(trim(lstr)//trim(timname)//'_rearr') endif + if (debug > 0) then + write(logunit,*) trim(subname),' newData FLB = ',n,minval(SDAT%avFLB(n)%rAttr),maxval(SDAT%avFLB(n)%rAttr),sum(SDAT%avFLB(n)%rAttr) + write(logunit,*) trim(subname),' newData FUB = ',n,minval(SDAT%avFUB(n)%rAttr),maxval(SDAT%avFUB(n)%rAttr),sum(SDAT%avFUB(n)%rAttr) + endif endif enddo @@ -816,6 +865,9 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) call shr_tInterp_getFactors(SDAT%ymdlb(n),SDAT%todlb(n),SDAT%ymdub(n),SDAT%todub(n), & ymdmod(n),todmod,flb,fub, & calendar=SDAT%stream(n)%calendar,algo=trim(SDAT%tintalgo(n))) + if (debug > 0) then + write(logunit,*) trim(subname),' interp = ',n,flb,fub + endif SDAT%avs(n)%rAttr(:,:) = SDAT%avFLB(n)%rAttr(:,:)*flb + SDAT%avFUB(n)%rAttr(:,:)*fub call t_stopf(trim(lstr)//trim(timname)//'_tint') @@ -824,6 +876,10 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) call mct_avect_zero(SDAT%avs(n)) call t_stopf(trim(lstr)//trim(timname)//'_zero') endif + if (debug > 0) then + write(logunit,*) trim(subname),' SDAT av = ',n,minval(SDAT%avs(n)%rAttr),maxval(SDAT%avs(n)%rAttr),sum(SDAT%avs(n)%rAttr) + endif + enddo deallocate(newData) @@ -877,8 +933,10 @@ subroutine shr_strdata_clean(SDAT) ! object itself. SDAT%nxg = 0 SDAT%nyg = 0 + SDAT%nzg = 0 SDAT%strnxg = 0 SDAT%strnyg = 0 + SDAT%strnzg = 0 SDAT%nstreams = 0 SDAT%nvectors = 0 @@ -1173,6 +1231,7 @@ subroutine shr_strdata_readnml(SDAT,file,rc,mpicom) SDAT%dtmax = 0.0 SDAT%nxg = 0 SDAT%nyg = 0 + SDAT%nzg = 0 SDAT%eccen = SHR_ORB_UNDEF_REAL SDAT%mvelpp = SHR_ORB_UNDEF_REAL SDAT%lambm0 = SHR_ORB_UNDEF_REAL @@ -1227,6 +1286,7 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg filePath, filename, fldListFile, fldListModel, & pio_subsystem, pio_iotype, & !--- strdata optional --- + nzg, domZvarName, & taxMode, dtlimit, tintalgo, & fillalgo, fillmask, fillread, fillwrite, & mapalgo, mapmask, mapread, mapwrite, & @@ -1253,7 +1313,7 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg character(*) ,intent(in) :: domFileName ! domain file name character(*) ,intent(in) :: domTvarName ! domain time dim name character(*) ,intent(in) :: domXvarName ! domain x dim name - character(*) ,intent(in) :: domYvarName ! domain y dim nam + character(*) ,intent(in) :: domYvarName ! domain y dim name character(*) ,intent(in) :: domAreaName ! domain area name character(*) ,intent(in) :: domMaskName ! domain mask name character(*) ,intent(in) :: filePath ! path to filenames @@ -1263,6 +1323,8 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg type(iosystem_desc_t), pointer :: pio_subsystem ! PIO subsystem pointer integer(IN) , intent(in) :: pio_iotype ! PIO file type + integer(IN) ,optional ,intent(in) :: nzg + character(*),optional ,intent(in) :: domZvarName ! domain z dim name character(*),optional ,intent(in) :: taxMode real(R8) ,optional ,intent(in) :: dtlimit character(*),optional ,intent(in) :: fillalgo ! fill algorithm @@ -1334,13 +1396,29 @@ subroutine shr_strdata_create(SDAT, name, mpicom, compid, gsmap, ggrid, nxg, nyg SDAT%calendar = trim(shr_cal_calendarName(trim(calendar))) endif - call shr_stream_set(SDAT%stream(1),yearFirst,yearLast,yearAlign,offset,taxMode, & + !---- Backwards compatibility requires Z be optional + + if (present(domZvarName)) then + call shr_stream_set(SDAT%stream(1),yearFirst,yearLast,yearAlign,offset,taxMode, & + fldListFile,fldListModel,domFilePath,domFileName, & + domTvarName,domXvarName,domYvarName,domZvarName, & + domAreaName,domMaskName, & + filePath,filename,trim(name)) + else + call shr_stream_set(SDAT%stream(1),yearFirst,yearLast,yearAlign,offset,taxMode, & fldListFile,fldListModel,domFilePath,domFileName, & - domTvarName,domXvarName,domYvarName,domAreaName,domMaskName, & + domTvarName,domXvarName,domYvarName,'undefined', & + domAreaName,domMaskName, & filePath,filename,trim(name)) + endif - call shr_strdata_init(SDAT, mpicom, compid, & - gsmap=gsmap, ggrid=ggrid, nxg=nxg, nyg=nyg) + if (present(nzg)) then + call shr_strdata_init(SDAT, mpicom, compid, & + gsmap=gsmap, ggrid=ggrid, nxg=nxg, nyg=nyg, nzg=nzg) + else + call shr_strdata_init(SDAT, mpicom, compid, & + gsmap=gsmap, ggrid=ggrid, nxg=nxg, nyg=nyg, nzg=1) + endif end subroutine shr_strdata_create @@ -1402,6 +1480,7 @@ subroutine shr_strdata_print(SDAT,name) write(logunit,F00) "domainFile = ",trim(SDAT%domainFile) write(logunit,F01) "nxg = ",SDAT%nxg write(logunit,F01) "nyg = ",SDAT%nyg + write(logunit,F01) "nzg = ",SDAT%nzg write(logunit,F00) "calendar = ",trim(SDAT%calendar) write(logunit,F01) "io_type = ",SDAT%io_type write(logunit,F02) "eccen = ",SDAT%eccen @@ -1417,6 +1496,7 @@ subroutine shr_strdata_print(SDAT,name) write(logunit,F07) " dtlimit (",n,") = ",SDAT%dtlimit(n) write(logunit,F05) " strnxg (",n,") = ",SDAT%strnxg(n) write(logunit,F05) " strnyg (",n,") = ",SDAT%strnyg(n) + write(logunit,F05) " strnzg (",n,") = ",SDAT%strnzg(n) write(logunit,F06) " dofill (",n,") = ",SDAT%dofill(n) write(logunit,F04) " fillalgo(",n,") = ",trim(SDAT%fillalgo(n)) write(logunit,F04) " fillmask(",n,") = ",trim(SDAT%fillmask(n)) diff --git a/share/csm_share/shr/shr_stream_mod.F90 b/share/csm_share/shr/shr_stream_mod.F90 index 2c24a737e04..e4badc0f143 100644 --- a/share/csm_share/shr/shr_stream_mod.F90 +++ b/share/csm_share/shr/shr_stream_mod.F90 @@ -138,7 +138,8 @@ module shr_stream_mod character(SHR_KIND_CL) :: domFileName ! domain file: name character(SHR_KIND_CS) :: domTvarName ! domain file: time-dim var name character(SHR_KIND_CS) :: domXvarName ! domain file: x-dim var name - character(SHR_KIND_CS) :: domYvarName ! domain file: y-dim var ame + character(SHR_KIND_CS) :: domYvarName ! domain file: y-dim var name + character(SHR_KIND_CS) :: domZvarName ! domain file: z-dim var name character(SHR_KIND_CS) :: domAreaName ! domain file: area var name character(SHR_KIND_CS) :: domMaskName ! domain file: mask var name @@ -505,6 +506,17 @@ subroutine shr_stream_init(strm,infoFile,yearFirst,yearLast,yearAlign,taxMode,rc call shr_string_listGetName (fldListFile,n,substr,rc) strm%domYvarName = subStr endif + !--- get vertical variable name --- + n = shr_string_listGetIndexF(fldListModel,"hgt") + if (n==0) then +! rCode = 1 +! write(s_logunit,F00) "ERROR: no input field names" +! call shr_stream_abort(subName//"ERROR: no lat variable name") + strm%domZvarName = 'unknownname' + else + call shr_string_listGetName (fldListFile,n,substr,rc) + strm%domZvarName = subStr + endif !--- get area variable name --- n = shr_string_listGetIndexF(fldListModel,"area") if (n==0) then @@ -632,7 +644,8 @@ end subroutine shr_stream_init subroutine shr_stream_set(strm,yearFirst,yearLast,yearAlign,offset,taxMode, & fldListFile,fldListModel,domFilePath,domFileName, & - domTvarName,domXvarName,domYvarName,domAreaName,domMaskName, & + domTvarName,domXvarName,domYvarName,domZvarName, & + domAreaName,domMaskName, & filePath,filename,dataSource,rc) ! !INPUT/OUTPUT PARAMETERS: @@ -649,7 +662,8 @@ subroutine shr_stream_set(strm,yearFirst,yearLast,yearAlign,offset,taxMode, & character(*) ,optional,intent(in) :: domFileName ! domain file name character(*) ,optional,intent(in) :: domTvarName ! domain time dim name character(*) ,optional,intent(in) :: domXvarName ! domain x dim name - character(*) ,optional,intent(in) :: domYvarName ! domain y dim nam + character(*) ,optional,intent(in) :: domYvarName ! domain y dim name + character(*) ,optional,intent(in) :: domZvarName ! domain z dim name character(*) ,optional,intent(in) :: domAreaName ! domain area name character(*) ,optional,intent(in) :: domMaskName ! domain mask name character(*) ,optional,intent(in) :: filePath ! path for filenames @@ -713,6 +727,9 @@ subroutine shr_stream_set(strm,yearFirst,yearLast,yearAlign,offset,taxMode, & if (present(domYvarName)) then strm%domYvarName = trim(domYvarName) endif + if (present(domZvarName)) then + strm%domZvarName = trim(domZvarName) + endif if (present(domAreaName)) then strm%domAreaName = trim(domAreaName) endif @@ -812,6 +829,7 @@ subroutine shr_stream_default(strm,rc) strm%domTvarName = ' ' strm%domXvarName = ' ' strm%domYvarName = ' ' + strm%domZvarName = ' ' strm%domAreaName = ' ' strm%domMaskName = ' ' @@ -1993,7 +2011,7 @@ end subroutine shr_stream_getCalendar ! ! !INTERFACE: ------------------------------------------------------------------ -subroutine shr_stream_getDomainInfo(strm,filePath,fileName,timeName,lonName,latName,maskName,areaName) +subroutine shr_stream_getDomainInfo(strm,filePath,fileName,timeName,lonName,latName,hgtName,maskName,areaName) ! !INPUT/OUTPUT PARAMETERS: @@ -2003,6 +2021,7 @@ subroutine shr_stream_getDomainInfo(strm,filePath,fileName,timeName,lonName,latN character(*) ,intent(out) :: timeName ! domain time var name character(*) ,intent(out) :: lonName ! domain lon var name character(*) ,intent(out) :: latName ! domain lat var name + character(*) ,intent(out) :: hgtName ! domain hgt var name character(*) ,intent(out) :: maskName ! domain mask var name character(*) ,intent(out) :: areaName ! domain area var name @@ -2017,6 +2036,7 @@ subroutine shr_stream_getDomainInfo(strm,filePath,fileName,timeName,lonName,latN timeName = strm%domTvarName lonName = strm%domXvarName latName = strm%domYvarName + hgtName = strm%domZvarName maskName = strm%domMaskName areaName = strm%domAreaName @@ -2441,7 +2461,8 @@ subroutine shr_stream_restWrite(strm,fileName,caseName,caseDesc,nstrms,rc) write(nUnit) strm(k)%domFilePath ! domain file: path write(nUnit) strm(k)%domTvarName ! domain file: time-dim var name write(nUnit) strm(k)%domXvarName ! domain file: x-dim var name - write(nUnit) strm(k)%domYvarName ! domain file: y-dim var ame + write(nUnit) strm(k)%domYvarName ! domain file: y-dim var name + write(nUnit) strm(k)%domZvarName ! domain file: z-dim var name write(nUnit) strm(k)%domAreaName ! domain file: area var name write(nUnit) strm(k)%domMaskName ! domain file: mask var name @@ -2661,7 +2682,8 @@ subroutine shr_stream_restRead(strm,fileName,nstrms,rc) read(nUnit) inpcl ! domFilePath ! domain file: path read(nUnit) inpcs ! domTvarName ! domain file: time-dim var name read(nUnit) inpcs ! domXvarName ! domain file: x-dim var name - read(nUnit) inpcs ! domYvarName ! domain file: y-dim var ame + read(nUnit) inpcs ! domYvarName ! domain file: y-dim var name + read(nUnit) inpcs ! domZvarName ! domain file: z-dim var name read(nUnit) inpcs ! domAreaName ! domain file: area var name read(nUnit) inpcs ! domMaskName ! domain file: mask var name @@ -2744,6 +2766,7 @@ subroutine shr_stream_dataDump(strm) write(s_logunit,F00) "domTvarName = ", trim(strm%domTvarName) write(s_logunit,F00) "domXvarName = ", trim(strm%domXvarName) write(s_logunit,F00) "domYvarName = ", trim(strm%domYvarName) + write(s_logunit,F00) "domZvarName = ", trim(strm%domZvarName) write(s_logunit,F00) "domAreaName = ", trim(strm%domAreaName) write(s_logunit,F00) "domMaskName = ", trim(strm%domMaskName) @@ -3089,6 +3112,7 @@ subroutine shr_stream_bcast(stream,comm,rc) call shr_mpi_bcast(stream%domTvarName ,comm,subName) call shr_mpi_bcast(stream%domXvarName ,comm,subName) call shr_mpi_bcast(stream%domYvarName ,comm,subName) + call shr_mpi_bcast(stream%domZvarName ,comm,subName) call shr_mpi_bcast(stream%domMaskName ,comm,subName) call shr_mpi_bcast(stream%calendar ,comm,subName) From e2db73bbe15d1fd7c1a7dccf0785fb8b4fc3618c Mon Sep 17 00:00:00 2001 From: apcraig Date: Fri, 29 Jan 2016 19:38:31 -0700 Subject: [PATCH 21/46] clean up debug write --- share/csm_share/shr/shr_dmodel_mod.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/share/csm_share/shr/shr_dmodel_mod.F90 b/share/csm_share/shr/shr_dmodel_mod.F90 index d048361cd12..89433ec93be 100644 --- a/share/csm_share/shr/shr_dmodel_mod.F90 +++ b/share/csm_share/shr/shr_dmodel_mod.F90 @@ -841,7 +841,6 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs rcode = pio_inq_varid(pioid,trim(sfldName),varid) frame = nt call pio_setframe(pioid,varid,frame) - write(logunit,*) subname,' read ',trim(sfldName),k call pio_read_darray(pioid,varid,pio_iodesc,av%rattr(k,:),rcode) enddo From 1259f43013ed57e55d2bcaa052d3977ecee0a72b Mon Sep 17 00:00:00 2001 From: apcraig Date: Mon, 8 Feb 2016 12:42:15 -0700 Subject: [PATCH 22/46] Update compsets and grids for single column pop capability. --- cime_config/cesm/allactive/config_compsets.xml | 5 +++++ cime_config/cesm/config_grids.xml | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/cime_config/cesm/allactive/config_compsets.xml b/cime_config/cesm/allactive/config_compsets.xml index 442bc1c2f18..edbdeb9e4d6 100644 --- a/cime_config/cesm/allactive/config_compsets.xml +++ b/cime_config/cesm/allactive/config_compsets.xml @@ -39,6 +39,11 @@ + + B1D + 2000_CAM4_CLM40%SP_CICE_POP2%1D_RTM_SGLC_SWAV + + B1850G 1850_CAM55_CLM50%BGC-CROP_CICE_POP2_MOSART_CISM1%NOEVOLVE_SWAV diff --git a/cime_config/cesm/config_grids.xml b/cime_config/cesm/config_grids.xml index 3e73416be68..92029d3286a 100644 --- a/cime_config/cesm/config_grids.xml +++ b/cime_config/cesm/config_grids.xml @@ -28,6 +28,13 @@ Non-standard grid for testing of the interpolation in DATM rather than coupler + + a%01col_l%01col_oi%01col_r%null_m%01col_g%null_w%null + 01col_01col + 1D_1D + Non-standard grid for running POP in true 1D mode + + CLM_USRDAT a%CLM_USRDAT_l%CLM_USRDAT_oi%CLM_USRDAT_r%null_m%reg_g%null_w%null @@ -564,6 +571,13 @@ null is no grid: + + 1 1 + domain.ocn.01col.ArcticOcean.20150824.nc + domain.ocn.01col.ArcticOcean.20150824.nc + 01col is a single-column grid for datm and POP: + + 1 1 domain.lnd.${CLM_USRDAT_NAME}_navy.nc From 89e1b54895024e3d24acfd09312a7cf14ccfb794 Mon Sep 17 00:00:00 2001 From: apcraig Date: Wed, 10 Feb 2016 09:38:40 -0700 Subject: [PATCH 23/46] add BARRIER_OPTION to driver and new logic for opening and closing files in the streams input to improve performance. --- driver_cpl/bld/build-namelist | 4 + .../namelist_files/namelist_defaults_drv.xml | 4 + .../namelist_definition_drv.xml | 34 ++++++- driver_cpl/cime_config/config_component.xml | 32 ++++++ driver_cpl/driver/cesm_comp_mod.F90 | 8 ++ driver_cpl/shr/seq_timemgr_mod.F90 | 30 +++++- share/csm_share/shr/shr_dmodel_mod.F90 | 30 +++++- share/csm_share/shr/shr_strdata_mod.F90 | 4 + share/csm_share/shr/shr_stream_mod.F90 | 99 ++++++++++++++++++- 9 files changed, 233 insertions(+), 12 deletions(-) diff --git a/driver_cpl/bld/build-namelist b/driver_cpl/bld/build-namelist index d309ad48b33..cbc632ece6e 100755 --- a/driver_cpl/bld/build-namelist +++ b/driver_cpl/bld/build-namelist @@ -576,6 +576,10 @@ add_default($nl, 'histavg_option'); add_default($nl, 'histavg_n'); add_default($nl, 'histavg_ymd'); +add_default($nl, 'barrier_option'); +add_default($nl, 'barrier_n'); +add_default($nl, 'barrier_ymd'); + add_default($nl, 'tprof_option'); add_default($nl, 'tprof_n'); add_default($nl, 'tprof_ymd'); diff --git a/driver_cpl/bld/namelist_files/namelist_defaults_drv.xml b/driver_cpl/bld/namelist_files/namelist_defaults_drv.xml index 7e27e258431..27f17426879 100644 --- a/driver_cpl/bld/namelist_files/namelist_defaults_drv.xml +++ b/driver_cpl/bld/namelist_files/namelist_defaults_drv.xml @@ -27,6 +27,10 @@ $AVGHIST_DATE 0.0 +$BARRIER_OPTION +$BARRIER_N +$BARRIER_DATE + diff --git a/driver_cpl/bld/namelist_files/namelist_definition_drv.xml b/driver_cpl/bld/namelist_files/namelist_definition_drv.xml index a9156a7f55a..3049d15416f 100644 --- a/driver_cpl/bld/namelist_files/namelist_definition_drv.xml +++ b/driver_cpl/bld/namelist_files/namelist_definition_drv.xml @@ -1223,8 +1223,8 @@ type="char*16" category="time" group="seq_timemgr_inparm" valid_values="none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,monthly,nmonth,nyears,nyear,date,ifdays0,end"> -sets the run length with stop_n and stop_ymd -stop_option alarms are: +sets the restart frequency with restart_n and restart_ymd +restart_option alarms are: [none/never], turns option off [nstep/s] , restarts every restart_n nsteps , relative to current run start time [nsecond/s] , restarts every restart_n nseconds, relative to current run start time @@ -1244,7 +1244,7 @@ id="restart_n" type="integer" category="time" group="seq_timemgr_inparm"> -Ssets model restart writes with restart_option and restart_ymd (same options as stop_n) +Sets model restart writes with restart_option and restart_ymd (same options as stop_n) + +sets the driver barrier frequency to sync models across all tasks with barrier_n and barrier_ymd +barrier_option alarms are like restart_option +default: never + + + +Sets model barriers with barrier_option and barrier_ymd (same options as stop_n) +default: 1 + + + +Date in yyyymmdd format, sets model barriers date with barrier_option and barrier_n + + + + char + none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end + never + run_begin_stop_restart + env_run.xml + + sets frequency of full model barrier (same options as STOP_OPTION) for synchronization with BARRIER_N and BARRIER_DATE + + + + + char + 1 + run_begin_stop_restart + env_run.xml + + sets periodic model barriers with BARRIER_OPTION and BARRIER_DATE for synchronization + + + + + char + -999 + run_begin_stop_restart + env_run.xml + + Alternative date in yyyymmdd format + sets periodic model barriers with BARRIER_OPTION and BARRIER_N for synchronization + + + logical TRUE,FALSE diff --git a/driver_cpl/driver/cesm_comp_mod.F90 b/driver_cpl/driver/cesm_comp_mod.F90 index 14695b91254..f4204e4fa0f 100644 --- a/driver_cpl/driver/cesm_comp_mod.F90 +++ b/driver_cpl/driver/cesm_comp_mod.F90 @@ -251,6 +251,7 @@ module cesm_comp_mod logical :: rofrun_alarm ! rof run alarm logical :: wavrun_alarm ! wav run alarm logical :: tprof_alarm ! timing profile alarm + logical :: barrier_alarm ! barrier alarm logical :: t1hr_alarm ! alarm every hour logical :: t2hr_alarm ! alarm every two hours logical :: t3hr_alarm ! alarm every three hours @@ -1954,6 +1955,7 @@ subroutine cesm_run() history_alarm = seq_timemgr_alarmIsOn(EClock_d,seq_timemgr_alarm_history) histavg_alarm = seq_timemgr_alarmIsOn(EClock_d,seq_timemgr_alarm_histavg) tprof_alarm = seq_timemgr_alarmIsOn(EClock_d,seq_timemgr_alarm_tprof) + barrier_alarm = seq_timemgr_alarmIsOn(EClock_d,seq_timemgr_alarm_barrier) ! this probably belongs in seq_timemgr somewhere using proper clocks t1hr_alarm = .false. @@ -3556,6 +3558,12 @@ subroutine cesm_run() endif call t_drvstopf ('CPL:TPROF_WRITE',cplrun=.true.) + call t_drvstartf ('CPL:BARRIERALARM',cplrun=.true.) + if (barrier_alarm) then + call mpi_barrier(mpicom_GLOID,ierr) + endif + call t_drvstopf ('CPL:BARRIERALARM',cplrun=.true.) + enddo ! driver run loop !|---------------------------------------------------------- diff --git a/driver_cpl/shr/seq_timemgr_mod.F90 b/driver_cpl/shr/seq_timemgr_mod.F90 index 6d2c0384a65..2cd33118105 100644 --- a/driver_cpl/shr/seq_timemgr_mod.F90 +++ b/driver_cpl/shr/seq_timemgr_mod.F90 @@ -108,6 +108,7 @@ module seq_timemgr_mod ! seq_timemgr_alarm_ocnnext ! seq_timemgr_alarm_tprof ! seq_timemgr_alarm_histavg +! seq_timemgr_alarm_barrier !EOP @@ -163,7 +164,7 @@ module seq_timemgr_mod (/'drv ','atm ','lnd ','ocn ', & 'ice ','glc ','wav ','rof '/) - integer(SHR_KIND_IN),private,parameter :: max_alarms = 15 + integer(SHR_KIND_IN),private,parameter :: max_alarms = 16 character(len=*),public,parameter :: & seq_timemgr_alarm_restart = 'seq_timemgr_alarm_restart ', & seq_timemgr_alarm_run = 'seq_timemgr_alarm_run ', & @@ -179,7 +180,8 @@ module seq_timemgr_mod seq_timemgr_alarm_tprof = 'seq_timemgr_alarm_tprof ', & seq_timemgr_alarm_histavg = 'seq_timemgr_alarm_histavg ', & seq_timemgr_alarm_rofrun = 'seq_timemgr_alarm_rofrun ', & - seq_timemgr_alarm_wavrun = 'seq_timemgr_alarm_wavrun ' + seq_timemgr_alarm_wavrun = 'seq_timemgr_alarm_wavrun ', & + seq_timemgr_alarm_barrier = 'seq_timemgr_alarm_barrier ' integer(SHR_KIND_IN),private,parameter :: & seq_timemgr_nalarm_restart = 1, & seq_timemgr_nalarm_run = 2, & @@ -195,7 +197,8 @@ module seq_timemgr_mod seq_timemgr_nalarm_tprof =12, & seq_timemgr_nalarm_histavg =13, & seq_timemgr_nalarm_rofrun =14, & - seq_timemgr_nalarm_wavrun =15 + seq_timemgr_nalarm_wavrun =15, & + seq_timemgr_nalarm_barrier =16 type EClock_pointer ! needed for array of pointers type(ESMF_Clock),pointer :: EClock => null() @@ -291,6 +294,9 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi character(SHR_KIND_CS) :: histavg_option ! Histavg option units integer(SHR_KIND_IN) :: histavg_n ! Number until histavg interval integer(SHR_KIND_IN) :: histavg_ymd ! Histavg date (YYYYMMDD) + character(SHR_KIND_CS) :: barrier_option ! Barrier option units + integer(SHR_KIND_IN) :: barrier_n ! Number until barrier interval + integer(SHR_KIND_IN) :: barrier_ymd ! Barrier date (YYYYMMDD) character(SHR_KIND_CS) :: tprof_option ! tprof option units integer(SHR_KIND_IN) :: tprof_n ! Number until tprof interval integer(SHR_KIND_IN) :: tprof_ymd ! tprof date (YYYYMMDD) @@ -327,6 +333,7 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi restart_option, restart_n, restart_ymd, & history_option, history_n, history_ymd, & histavg_option, histavg_n, histavg_ymd, & + barrier_option, barrier_n, barrier_ymd, & tprof_option, tprof_n, tprof_ymd, & start_ymd, start_tod, ref_ymd, ref_tod, & atm_cpl_dt, ocn_cpl_dt, ice_cpl_dt, lnd_cpl_dt, & @@ -372,6 +379,9 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi histavg_option = seq_timemgr_optNever histavg_n = -1 histavg_ymd = -1 + barrier_option = seq_timemgr_optNever + barrier_n = -1 + barrier_ymd = -1 tprof_option = seq_timemgr_optNever tprof_n = -1 tprof_ymd = -1 @@ -505,6 +515,9 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi write(logunit,F0A) trim(subname),' histavg_option = ',trim(histavg_option) write(logunit,F0I) trim(subname),' histavg_n = ',histavg_n write(logunit,F0I) trim(subname),' histavg_ymd = ',histavg_ymd + write(logunit,F0A) trim(subname),' barrier_option = ',trim(barrier_option) + write(logunit,F0I) trim(subname),' barrier_n = ',barrier_n + write(logunit,F0I) trim(subname),' barrier_ymd = ',barrier_ymd write(logunit,F0A) trim(subname),' tprof_option = ',trim(tprof_option) write(logunit,F0I) trim(subname),' tprof_n = ',tprof_n write(logunit,F0I) trim(subname),' tprof_ymd = ',tprof_ymd @@ -584,6 +597,9 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi call shr_mpi_bcast( histavg_option, mpicom ) call shr_mpi_bcast( histavg_ymd, mpicom ) call shr_mpi_bcast( tprof_n, mpicom ) + call shr_mpi_bcast( barrier_n, mpicom ) + call shr_mpi_bcast( barrier_option, mpicom ) + call shr_mpi_bcast( barrier_ymd, mpicom ) call shr_mpi_bcast( tprof_option, mpicom ) call shr_mpi_bcast( tprof_ymd, mpicom ) call shr_mpi_bcast( start_ymd, mpicom ) @@ -733,6 +749,14 @@ subroutine seq_timemgr_clockInit(SyncClock, nmlfile, restart, restart_file, pioi RefTime = StartTime, & alarmname = trim(seq_timemgr_alarm_histavg)) + call seq_timemgr_alarmInit(SyncClock%ECP(n)%EClock, & + EAlarm = SyncClock%EAlarm(n,seq_timemgr_nalarm_barrier), & + option = barrier_option, & + opt_n = barrier_n, & + opt_ymd = barrier_ymd, & + RefTime = CurrTime, & + alarmname = trim(seq_timemgr_alarm_barrier)) + call seq_timemgr_alarmInit(SyncClock%ECP(n)%EClock, & EAlarm = SyncClock%EAlarm(n,seq_timemgr_nalarm_tprof), & option = tprof_option, & diff --git a/share/csm_share/shr/shr_dmodel_mod.F90 b/share/csm_share/shr/shr_dmodel_mod.F90 index 89433ec93be..b359025db89 100644 --- a/share/csm_share/shr/shr_dmodel_mod.F90 +++ b/share/csm_share/shr/shr_dmodel_mod.F90 @@ -631,7 +631,7 @@ subroutine shr_dmodel_readLBUB(stream,pio_subsystem,pio_iotype,pio_iodesc,mDate, call t_stopf(trim(lstr)//'_LB_copy') else if (my_task == master_task) then - write(logunit,F02) 'reading file: ',trim(path),trim(fn_lb),n_lb + write(logunit,F02) 'file lb: ',trim(path),trim(fn_lb),n_lb call shr_sys_flush(logunit) endif call shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gsMap, avLB, mpicom, & @@ -642,7 +642,7 @@ subroutine shr_dmodel_readLBUB(stream,pio_subsystem,pio_iotype,pio_iodesc,mDate, if (mDateUB /= oDateUB .or. mSecUB /= oSecUB) then newdata = .true. if (my_task == master_task) then - write(logunit,F02) 'reading file: ',trim(path),trim(fn_ub),n_ub + write(logunit,F02) 'file ub: ',trim(path),trim(fn_ub),n_ub call shr_sys_flush(logunit) endif call shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gsMap, avUB, mpicom, & @@ -723,6 +723,8 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs character(CL) :: sfldName type(mct_avect) :: avtmp character(len=32) :: lstr + logical :: fileopen + character(CL) :: currfile integer(in) :: ndims integer(in),pointer :: dimid(:) @@ -817,7 +819,28 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs call t_startf(trim(lstr)//'_readpio') call shr_mpi_bcast(sfldName,mpicom,'sfldName') call shr_mpi_bcast(filename,mpicom,'filename') - rcode = pio_openfile(pio_subsystem, pioid, pio_iotype, trim(filename), pio_nowrite) + + call shr_stream_getCurrFile(stream,fileopen=fileopen,currfile=currfile,currpioid=pioid) + + if (fileopen .and. currfile==filename) then + ! don't reopen file, all good + else + ! otherwise close the old file if open and open new file + if (fileopen) then + if (my_task == master_task) then + write(logunit,F00) 'close : ',trim(currfile) + call shr_sys_flush(logunit) + endif + call pio_closefile(pioid) + endif + if (my_task == master_task) then + write(logunit,F00) 'open : ',trim(filename) + call shr_sys_flush(logunit) + endif + rcode = pio_openfile(pio_subsystem, pioid, pio_iotype, trim(filename), pio_nowrite) + call shr_stream_setCurrFile(stream,fileopen=.true.,currfile=trim(filename),currpioid=pioid) + endif + call pio_seterrorhandling(pioid,PIO_INTERNAL_ERROR) rcode = pio_inq_varid(pioid,trim(sfldName),varid) @@ -844,7 +867,6 @@ subroutine shr_dmodel_readstrm(stream, pio_subsystem, pio_iotype, pio_iodesc, gs call pio_read_darray(pioid,varid,pio_iodesc,av%rattr(k,:),rcode) enddo - call pio_closefile(pioid) call t_stopf(trim(lstr)//'_readpio') endif diff --git a/share/csm_share/shr/shr_strdata_mod.F90 b/share/csm_share/shr/shr_strdata_mod.F90 index f531668fef4..4b7a8b9276a 100644 --- a/share/csm_share/shr/shr_strdata_mod.F90 +++ b/share/csm_share/shr/shr_strdata_mod.F90 @@ -577,6 +577,9 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) if (.not.ltimers) call t_adj_detailf(tadj) + call t_barrierf(trim(lstr)//trim(timname)//'_total_BARRIER',mpicom) + call t_startf(trim(lstr)//trim(timname)//'_total') + call MPI_COMM_SIZE(mpicom,npes,ierr) call MPI_COMM_RANK(mpicom,my_task,ierr) @@ -886,6 +889,7 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) endif ! nstreams > 0 + call t_stopf(trim(lstr)//trim(timname)//'_total') if (.not.ltimers) call t_adj_detailf(-tadj) end subroutine shr_strdata_advance diff --git a/share/csm_share/shr/shr_stream_mod.F90 b/share/csm_share/shr/shr_stream_mod.F90 index 2066f0f0a6f..1ad9060e9a8 100644 --- a/share/csm_share/shr/shr_stream_mod.F90 +++ b/share/csm_share/shr/shr_stream_mod.F90 @@ -41,6 +41,7 @@ module shr_stream_mod use shr_log_mod, only : s_loglev => shr_log_Level use shr_log_mod, only : s_logunit => shr_log_Unit use shr_log_mod, only : OOBMsg => shr_log_OOBMsg + use pio, only : file_desc_t use perf_mod implicit none @@ -72,6 +73,8 @@ module shr_stream_mod public :: shr_stream_getFile ! acquire file, return name of file to open public :: shr_stream_getNFiles ! get the number of files in a stream public :: shr_stream_getCalendar ! get the stream calendar + public :: shr_stream_getCurrFile ! get the currfile, fileopen, and currpioid + public :: shr_stream_setCurrFile ! set the currfile, fileopen, and currpioid public :: shr_stream_dataDump ! internal stream data for debugging public :: shr_stream_restWrite ! write a streams restart file public :: shr_stream_restRead ! read a streams restart file @@ -136,6 +139,11 @@ module shr_stream_mod integer(SHR_KIND_IN) :: k_gvd,n_gvd ! file/sample of greatest valid date logical :: found_gvd ! T <=> k_gvd,n_gvd have been set + !---- for keeping files open + logical :: fileopen ! is current file open + character(SHR_KIND_CL) :: currfile ! current filename + type(file_desc_t) :: currpioid ! current pio file desc + !--- stream data not used by stream module itself --- character(SHR_KIND_CXX):: fldListFile ! field list: file's field names character(SHR_KIND_CXX):: fldListModel ! field list: model's field names @@ -746,8 +754,10 @@ subroutine shr_stream_set(strm,yearFirst,yearLast,yearAlign,offset,taxMode, & strm%filePath = trim(filePath) endif if (present(filename)) then - write(s_logunit,F01) "size of filename = ",size(filename) - write(s_logunit,F00) "filename = ",filename + if (debug>1 .and. s_loglev > 0) then + write(s_logunit,F01) "size of filename = ",size(filename) + write(s_logunit,F00) "filename = ",filename + endif do n = 1,size(filename) ! Ignore null file names. @@ -828,6 +838,9 @@ subroutine shr_stream_default(strm,rc) strm%n_gvd = -1 strm%found_gvd = .false. + strm%fileopen = .false. + strm%currfile = '' + strm%fldListFile = ' ' strm%fldListModel = ' ' strm%domFilePath = ' ' @@ -2004,6 +2017,86 @@ subroutine shr_stream_getCalendar(strm,k,calendar) end subroutine shr_stream_getCalendar +!=============================================================================== +!BOP =========================================================================== +! +! !IROUTINE: shr_stream_getCurrFile -- return open file information +! +! !DESCRIPTION: +! returns current file information +! +! !REVISION HISTORY: +! 2015-Nov-24 - T. Craig +! +! !INTERFACE: ------------------------------------------------------------------ + +subroutine shr_stream_getCurrFile(strm,fileopen,currfile,currpioid) + +! !INPUT/OUTPUT PARAMETERS: + + type(shr_stream_streamType),intent(in) :: strm ! data stream + logical ,optional,intent(out) :: fileopen ! file open flag + character(*) ,optional,intent(out) :: currfile ! current filename + type(file_desc_t) ,optional,intent(out) :: currpioid ! current pioid + +!EOP + +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + + if (present(fileopen)) then + fileopen = strm%fileopen + endif + if (present(currfile)) then + currfile = strm%currfile + endif + if (present(currpioid)) then + currpioid = strm%currpioid + endif + +end subroutine shr_stream_getCurrFile + +!=============================================================================== +!BOP =========================================================================== +! +! !IROUTINE: shr_stream_setCurrFile -- return open file information +! +! !DESCRIPTION: +! returns current file information +! +! !REVISION HISTORY: +! 2015-Nov-24 - T. Craig +! +! !INTERFACE: ------------------------------------------------------------------ + +subroutine shr_stream_setCurrFile(strm,fileopen,currfile,currpioid) + +! !INPUT/OUTPUT PARAMETERS: + + type(shr_stream_streamType),intent(inout) :: strm ! data stream + logical ,optional,intent(in) :: fileopen ! file open flag + character(*) ,optional,intent(in) :: currfile ! current filename + type(file_desc_t) ,optional,intent(in) :: currpioid ! current pioid + +!EOP + +!------------------------------------------------------------------------------- +! +!------------------------------------------------------------------------------- + + if (present(fileopen)) then + strm%fileopen = fileopen + endif + if (present(currfile)) then + strm%currfile = currfile + endif + if (present(currpioid)) then + strm%currpioid = currpioid + endif + +end subroutine shr_stream_setCurrFile + !=============================================================================== !BOP =========================================================================== ! @@ -3111,6 +3204,8 @@ subroutine shr_stream_bcast(stream,comm,rc) call shr_mpi_bcast(stream%k_gvd ,comm,subName) call shr_mpi_bcast(stream%n_gvd ,comm,subName) call shr_mpi_bcast(stream%found_gvd ,comm,subName) + call shr_mpi_bcast(stream%fileopen ,comm,subName) + call shr_mpi_bcast(stream%currfile ,comm,subName) call shr_mpi_bcast(stream%fldListFile ,comm,subName) call shr_mpi_bcast(stream%fldListModel,comm,subName) call shr_mpi_bcast(stream%domFileName ,comm,subName) From 25aad261cc48d465540fc1f9785e8686c33dd498 Mon Sep 17 00:00:00 2001 From: katetc Date: Wed, 10 Feb 2016 13:16:44 -0700 Subject: [PATCH 24/46] Changed logger calls to prints in check_input_data to make sure the output capture in checkinputdata actually works, and missing files are appropriately downloaded. --- scripts/Tools/check_input_data | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/Tools/check_input_data b/scripts/Tools/check_input_data index 04a1a6a25ec..7ecca5e6f84 100755 --- a/scripts/Tools/check_input_data +++ b/scripts/Tools/check_input_data @@ -226,7 +226,7 @@ foreach $i (@filelocations) { if ($docheck) { if (($checkopt) && ($fileneed =~ m/.*(\w)+.*/)) { if (! -e $fileneed) { - $logger->warn( "File is missing: $fileneed "); + print "File is missing: $fileneed \n"; $status = 1; } } @@ -234,7 +234,7 @@ foreach $i (@filelocations) { my $fileloc = $svn_loc.$filend; # Location in subversion repository. my $lsearch = $fileloc; # Variable used in searches for symbolic links. isinrepository($fileloc) ? dataexport($fileneed, $fileloc) : - $logger->warn( "File was not found in svn repo: $fileloc "); + print "File was not found in svn repo: $fileloc \n"; } if (($isinput) && ($prestageopt)) { my $filecopy = $prestage_rootdir.$filend; @@ -242,13 +242,13 @@ foreach $i (@filelocations) { if (-d $fileneed) { system("umask 2; mkdir -p -m 775 $dirname"); system("cp $fileneed/* $filecopy/ 2>/dev/null"); - $logger->info( "Dir copied to: $filecopy "); + print "Dir copied to: $filecopy \n"; } else { if ((-e $fileneed) && (!-e $filecopy)) { $dirname =~ s!/[^/]+$!!; system("umask 2; mkdir -p -m 775 $dirname"); system("cp $fileneed $filecopy"); - $logger->info( "File copied to: $filecopy"); + print "File copied to: $filecopy\n"; } } } @@ -256,7 +256,7 @@ foreach $i (@filelocations) { else { if (($checkopt) && ($fileneed =~ m/.*(\w)+.*/)) { if (! -e $fileneed) { - $logger->info( "File status unknown: $fileneed "); + print "File status unknown: $fileneed \n"; } } } From f3cfb2097e1c35ae1bd21e658cfdcebcec10f01b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 10 Feb 2016 13:25:04 -0700 Subject: [PATCH 25/46] This branch is called mlevy/southern_ocean in the apcraig fork. There are two tags, southern_ocean_n01 which is just the streams4d update and southern_ocean_n02 which adds the stream open/close and the BARRIER_OPTION features. These changes add support for reading 4d stream data (3d space + time) and single column data, both which were tested in POP. The stream open/close feature reduces the number of open and closes done on stream input files to improve performance. The BARRIER_OPTION adds a new alarm to the driver to synchronize all tasks at a frequency specified by the BARRIER_OPTION/BARRIER_N setting. This is needed in some concurrent cases (datm/clm) where the datm model can advance in time asychronously from the rest of the model and cause MPI memory issues as data is waiting to be received. These modification have been tested with yellowstone_intel in a limited number of cases. Test suite: Test baseline: Test namelist changes: Test status: bit for bit Fixes: Code review: Jim Edwards --- .../cesm/allactive/config_compsets.xml | 238 +++++++++--------- 1 file changed, 119 insertions(+), 119 deletions(-) diff --git a/cime_config/cesm/allactive/config_compsets.xml b/cime_config/cesm/allactive/config_compsets.xml index edbdeb9e4d6..110b6630fe6 100644 --- a/cime_config/cesm/allactive/config_compsets.xml +++ b/cime_config/cesm/allactive/config_compsets.xml @@ -4,9 +4,9 @@ ========================================= - compset naming convention + compset naming convention ========================================= - The compset longname below has the specified order + The compset longname below has the specified order atm, lnd, ice, ocn, river, glc wave cesm-options The notation for the compset longname is @@ -20,17 +20,17 @@ ROF = [RTM, MOSART, SROF] GLC = [CISM1, CISM2, SGLC] WAV = [WW3, DWAV, XWAV, SWAV] - BGC = optional BGC scenario + BGC = optional BGC scenario The OPTIONAL %phys attributes specify submodes of the given system For example DOCN%DOM is the data ocean model for DOCN - ALL the possible %phys choices for each component are listed + ALL the possible %phys choices for each component are listed with the -list command for create_newcase - ALL data models must have a %phys option that corresponds to the data model mode + ALL data models must have a %phys option that corresponds to the data model mode Each compset node is associated with the following elements - - lname - - alias + - lname + - alias - support (optional description of the support level for this compset) Each compset node can also have the following attributes - grid (optional regular expression match for grid to work with the compset) @@ -40,7 +40,7 @@ - B1D + BC4L40P1DR 2000_CAM4_CLM40%SP_CICE_POP2%1D_RTM_SGLC_SWAV @@ -276,7 +276,7 @@ - + - 0001-01-01 + 0001-01-01 0001-01-01 - 1850-01-01 - 1950-01-01 + 1850-01-01 + 1950-01-01 2004-01-01 - 1955-01-01 + 1955-01-01 2005-01-01 - 2013-01-01 + 2013-01-01 From 1ada5bdbd089fe6fa95a6bbaf76e5fda3a240480 Mon Sep 17 00:00:00 2001 From: brian-eaton Date: Wed, 10 Feb 2016 13:38:13 -0700 Subject: [PATCH 26/46] add T85_T85 to config_grids.xml Specifying the T85_T85 grid gave the following output: ERROR: no supported grid match for target grid T85_T85 I added a T85_T85 entry to config_grids.xml analogous to the existing T42_T42 entry. This fixed the problem. Test suite: Test baseline: Test namelist changes: Test status: [bit for bit, roundoff, climate changing] Fixes: [CIME Github issue #] User interface changes?: [Yes (describe what changes), No] Code review: --- cime_config/cesm/config_grids.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cime_config/cesm/config_grids.xml b/cime_config/cesm/config_grids.xml index 3e73416be68..c466bc92253 100644 --- a/cime_config/cesm/config_grids.xml +++ b/cime_config/cesm/config_grids.xml @@ -121,6 +121,12 @@ a%T42_l%T42_oi%T42_r%r05_m%usgs_g%null_w%null + + T85_T85 + T85_T85 + a%T85_l%T85_oi%T85_r%r05_m%usgs_g%null_w%null + + T62_gx3v7 T62_g37 From be8e8857c2c68439ab31e84804980c64b45c4e41 Mon Sep 17 00:00:00 2001 From: Alice Bertini Date: Sun, 14 Feb 2016 14:59:39 -0700 Subject: [PATCH 27/46] Remove ExpectedFails.xml file from CIME and update testreporter.pl Remove ExpectedFails.xml file from CIME and update testreporter.pl in favor of having all-active expected test failures managed from the testdb. Components may still choose to work with an expected fails file for their stand-alone tests. Test suite: N/A Test baseline: N/A Test namelist changes: N/A Test status: bit for bit Fixes: start to fix for CIME issue #257 Code review: --- cime_config/cesm/ExpectedTestFails.xml | 72 ------- scripts/Testing/testreporter.pl | 251 ++++++++----------------- 2 files changed, 77 insertions(+), 246 deletions(-) delete mode 100644 cime_config/cesm/ExpectedTestFails.xml diff --git a/cime_config/cesm/ExpectedTestFails.xml b/cime_config/cesm/ExpectedTestFails.xml deleted file mode 100644 index 6e6f7465b79..00000000000 --- a/cime_config/cesm/ExpectedTestFails.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - -TFAIL ERI_Ld5.f19_g16.ITEST.edison_intel.clm-default -SFAIL ERP_Ln9.ne120_ne120.FC51850.bluewaters_pgi.cam-outfrq9s -SFAIL ERS_Ld9.ne120_g16.BHISTC5L45BGC.bluewaters_pgi.allactive-default -SFAIL ERP_Ln9.ne120_ne120.FC51850.eos_intel.cam-outfrq9s - -CFAIL ERS_IOP.T62_s11.G.yellowstone_pgi.pop-cice -CFAIL ERS_PT_Lm3.T62_g16.GIAF.yellowstone_intel.pop-cice -CFAIL PET_PT.T62_g16.G.yellowstone_intel.pop-cice -CFAIL ERS_Ld7.f19_g16.BRCP26W5CN.yellowstone_intel.allactive-default -CFAIL ERS_Ld7.f19_g16.BRCP45W5CN.yellowstone_pgi.allactive-default -CFAIL ERS_Ld7.f19_g16.BRCP85W5CN.yellowstone_gnu.allactive-default -CFAIL ERP_Ln9.f09_f09.FAMIPC5.bluewaters_pgi.cam-outfrq9s -CFAIL PET_PT.T62_g16.G.bluewaters_pgi.pop-cice -CFAIL CME_Ld5.T31_g37.B1850C5L45BGC.edison_intel.allactive-default -CFAIL ERP_D_Ld5.1x1_smallvilleIA.ICNCROP.edison_intel.clm-default -CFAIL PET_PT.T62_g16.G.edison_intel.pop-cice -CFAIL ERP_D_Ld5.1x1_smallvilleIA.ICNCROP.eos_intel.clm-default -CFAIL PET_PT.T62_g16.G.eos_intel.pop-cice -CFAIL PET_PT.T62_g16.G.yellowstone_pgi.pop-cice -CFAIL SMS_D.T62_s11.G.yellowstone_pgi.pop-cice - -RUN ERS_N2_Ld7.f19_g16.BHISTC5CN.yellowstone_gnu.allactive-default - -RUN ERS.f09_g16.B1850C5CN.bluewaters_pgi -RUN ERS_Ld7.ne16_g37.BC5.babbageKnc_intel -RUN ERS.T62_t12.G.bluewaters_pgi.pop-cice -RUN PET_PT.f19_g16.B1850C5.bluewaters_pgi.allactive-default -RUN ERS.T62_t12.G.edison_intel.pop-cice -RUN ERS_D.f19_g16_rx1.GECO.edison_intel.pop-cice_ecosys -RUN ERS_N2_Ld7.f19_g16.BHISTC5CN.edison_intel.allactive-default -RUN SMS_D.f09_g16.BPIPDC5L45BGC.edison_intel.allactive-default -RUN ERI.f09_g16.B1850C5L45BGC.bluewaters_pgi -RUN ERS.T62_t12.G.bluewaters_pgi.pop-cice -RUN ERS_Lm3.T62_g16.CECO.bluewaters_pgi.pop-ecosys -RUN ERP_Ln96.ne120_g16.I1850CN.edison_intel -RUN SMS_Ld5.f09_g16.BRCP85BPRP.edison_intel.allactive-default -RUN ERS.T62_t12.G.eos_intel.pop-cice -RUN ERS_Lm3.T62_g16.CECO.eos_intel.pop-ecosys -RUN PET_PT.ne30_g16.B1850C5L45BGC.eos_intel.allactive-default -RUN ERP_Ln9.f09_f09.FAMIPC5.mira_ibm.cam-outfrq9s -RUN ERS_D_Ld7.ne30_g16.B1850C5L45BGC.mira_ibm.allactive-default -RUN SMS_Ld1.ne30_ne30.PC5.yellowstone_intel.cam-cam5_port -RUN ERS.T62_t12.G.eos_intel.pop-cice -RUN ERS_Ld11.f09_g16.B1850BDRD.mira_ibm.allactive-default -RUN ERS_Ld5.f09_g16.ETEST.mira_ibm.cice-default -RUN ERS_Ld7.f09_g16.B1850RMCN.mira_ibm.allactive-default -RUN ERP_D_Ln9.f19_f19.F.hobart_nag.cam-outfrq9s.GC.cesm14a07enag -RUN ERP_D_Ln9.f19_f19.FC5AQUAP.hobart_nag.cam-outfrq9s.GC.cesm14a07enag -RUN ERP_D_Ln9.f19_f19.FWTC4L40CCMIR1.hobart_nag.cam-outfrq9s.GC.cesm14a07enag -RUN ERS_Ld5.f19_g16.ETEST.hobart_nag.cice-default.GC.cesm14a07enag -RUN SMS_D.f19_f19.PC5.hobart_nag.cam-cam5_port.GC.cesm14a07enag -RUN SMS_D_Mmpi-serial_Ld1.T42_T42.FSCM5A97.hobart_nag.cam-outfrq1d.GC.cesm14a07enag -RUN ERS_Ld9.ne120_g16.B1850C5L45BGC.mira_ibm.allactive-default - - FAIL ERP_Ld9.f19_f19.FSTRATSOA.yellowstone_gnu.cam-outfrq9s.cpl.hi.nc : baseline compare cpl.hi (baseline: compare .base file with debug_b18base file) - FAIL ERS_IOP_Ld11.f09_g16.BHISTBPRP.yellowstone_intel.allactive-default.pop.h.nc : test compare pop.h (.rest and .rest_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.cam.h0.nc : test compare cam.h0 (.base and .base_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.cam.h0.nc : test compare cam.h0 (.rest and .rest_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.clm2.h0.nc : test compare clm2.h0 (.base and .base_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.clm2.h0.nc : test compare clm2.h0 (.rest and .rest_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.pop.h.nc : test compare pop.h (.base and .base_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.pop.h.nc : test compare pop.h (.rest and .rest_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.cpl.hi.nc : test compare cpl.hi (.base and .base_pnetcdf files) - FAIL ERS_IOP_Ld11.f09_g16.BPIPDC5L45BGC.yellowstone_intel.allactive-default.cpl.hi.nc : test compare cpl.hi (.rest and .rest_pnetcdf files) - FAIL ERS_Ld7.f19_g16.BGRCP85CN.yellowstone_pgi.allactive-cism-test_coupling.clm2.h0.nc : test compare clm2.h0 (.base and .rest files) - FAIL ERS_Lm3.f09_g16.B1850C5L45BGC.yellowstone_intel.pop.h.nc : test compare pop.h (.base and .rest files) - - diff --git a/scripts/Testing/testreporter.pl b/scripts/Testing/testreporter.pl index 2b6d9331884..4dcd6d1561f 100755 --- a/scripts/Testing/testreporter.pl +++ b/scripts/Testing/testreporter.pl @@ -42,10 +42,6 @@ my $dumpxml = 0; my $printreport = 0; my $dryrun = 0; -# full path to the expected fails file. -my $expectedFailsFile; -# Hash with expected fails data -my %xfailsData; my $username = undef; my $password = undef; @@ -65,21 +61,20 @@ %suiteinfo = &getTestSuiteInfo(\@testdirs); my $teststatus; my $nlfailreport; -my $xfailelems = getExpectedFails(); -($teststatus, $nlfailreport) = getTestStatus(\@testdirs, $tagname, $testid, $xfailelems); +($teststatus, $nlfailreport) = getTestStatus(\@testdirs, $tagname, $testid); &Debug( eval { Dumper $teststatus} ); &Debug( eval { Dumper \%suiteinfo } ); my $testxml = &makeResultsXml($teststatus, \%suiteinfo, $nlfailreport); if(!$dryrun) { - &sendresults(\%teststatus, \%suiteinfo, $testxml); + &sendresults(\%teststatus, \%suiteinfo, $testxml); } &printreport($teststatus, $nlfailreport) if $printreport; #------------------------------------------------------------------------------- # End Main #------------------------------------------------------------------------------- - + #------------------------------------------------------------------------------- # Get the options. #------------------------------------------------------------------------------- @@ -95,23 +90,12 @@ sub opts "help" => \$opt_help, "dumpxml|x" => \$dumpxml, "printreport|p" => \$printreport, - "expectedfails=s" => \$expectedFailsFile, "dryrun" => \$dryrun, - ); # Show usage if the required options aren't specified. &help if (defined $opt_help); - #&usage if ( (! defined $testroot) ||(! defined $tagname) || (! defined $testid) || (!defined $testtype) || (! defined $expectedFailsFile)); &usage if ( (! defined $testroot) ||(! defined $tagname) || (! defined $testid) || (!defined $testtype)); - if(defined $expectedFailsFile) - { - $expectedFailsFile = abs_path($expectedFailsFile); - } - else - { - $expectedFailsFile = undef; - } } #------------------------------------------------------------------------------- @@ -121,10 +105,9 @@ sub usage { print <<'END'; Usage: - ./testreporter --testroot /glade/scratch/$user/tests/cesm1_1_alphaXX --tagname cesm1_1_alpha15c --testid testid --testtype prealpha|prebeta|prerelease --expectedfails expectedfailsfile - [--dumpxml|--printreport] + ./testreporter.pl --testroot /glade/scratch/$user/tests/cesm1_1_alphaXX --tagname cesm1_1_alpha15c --testid testid --testtype prealpha|prebeta|prerelease [--dumpxml|--printreport] END - exit(1); + exit(1); } sub help @@ -147,7 +130,6 @@ sub help tag used. --testid The testid you specified to create_test_suite. --testtype The type of test you are running: prealpha, prebeta, or prerelease. - --expectedfails The path to the expected fails file, ususally in the $SRCROOT END } @@ -166,22 +148,6 @@ sub Debug } - - -#------------------------------------------------------------------------------- -# Read the expected fails xml file. -#------------------------------------------------------------------------------- -sub getExpectedFails -{ - my $parser = XML::LibXML->new; - my $xfails = $parser->parse_file($expectedFailsFile); - my $root = $xfails->getDocumentElement(); - my @xfailelems = $root->findnodes('/expectedFails/entry'); - #print Dumper \@xfailelems; - - return \@xfailelems; -} - #------------------------------------------------------------------------------- # Using the testroot, find the test directories that end with the specified testid. # If no matching directories are found, then exit. @@ -234,45 +200,43 @@ sub getTestSuiteInfo } } &Debug("test path: $testpath\n"); - - # We need to find SetupTools in a path-independent manner. - # so parse out the cimeroot from testspec.*.xml, - # get rid of the tags, and then we have + + # We need to find SetupTools in a path-independent manner. + # so parse out the cimeroot from testspec.*.xml, + # get rid of the tags, and then we have #my $testspecfile = "$testroot/testspec.$testid.$caseinfo{'mach'}.xml"; my $testspecfile = "$testroot/testspec.$testid.xml"; Debug( "testspecfile: $testspecfile\n"); - open my $SPEC, '<', $testspecfile or die "could not open $testspecfile, $!"; - my @testspeclines = <$SPEC>; - my @cimerootlines = grep { // } @testspeclines; - #my @cimerootlines = grep { /^/ } <$SPEC>; - close $SPEC; - chomp @cimerootlines; - my $cimeroot = $cimerootlines[0]; - if(! defined $cimeroot) - { - die "cimeroot not defined, aborting.."; - } - - $cimeroot =~ s/|<\/cimeroot>|^\s+|\s+$//g; - #$cimeroot =~ s/<\/cimeroot>//g; - Debug("cimeroot is now: |$cimeroot|"); - #my @dirs = ( $testpath, $testpath . "../utils/perl5lib"); + open my $SPEC, '<', $testspecfile or die "could not open $testspecfile, $!"; + my @testspeclines = <$SPEC>; + my @cimerootlines = grep { // } @testspeclines; + #my @cimerootlines = grep { /^/ } <$SPEC>; + close $SPEC; + chomp @cimerootlines; + my $cimeroot = $cimerootlines[0]; + if(! defined $cimeroot) + { + die "cimeroot not defined, aborting.."; + } + + $cimeroot =~ s/|<\/cimeroot>|^\s+|\s+$//g; + Debug("cimeroot is now: |$cimeroot|"); my @dirs = ( $testpath, "$cimeroot/utils/perl5lib"); unshift @INC, @dirs; - - # SetupTools needs a case to work, so why not just cd to the - # first test directory, and run SetupTools there?? :) - my $firsttestdir = $testroot . "/" . $$testlist[0]; - Debug("first test dir: $firsttestdir"); + + # SetupTools needs a case to work, so why not just cd to the + # first test directory, and run SetupTools there?? :) + my $firsttestdir = $testroot . "/" . $$testlist[0]; + Debug("first test dir: $firsttestdir"); require Config::SetupTools; - chdir $firsttestdir; + chdir $firsttestdir; my %config = SetupTools::getAllResolved(); $caseinfo{'mach'} = $config{'MACH'}; $caseinfo{'compiler'} = $config{'COMPILER'}; $caseinfo{'mpilib'} = $config{'MPILIB'}; - chdir $testroot; + chdir $testroot; my $parser = XML::LibXML->new; my $spec = $parser->parse_file($testspecfile); @@ -280,18 +244,17 @@ sub getTestSuiteInfo my @bltagnodes = $root->findnodes('/testlist/baselinetag'); $caseinfo{'baselinetag'} = $bltagnodes[0]->textContent(); &Debug( "baselinetag: $caseinfo{'baselinetag'}\n") ; - - # Get the expectedFailsFile. - if(! defined $expectedFailsFile) - { - my @cimeroots = $root->findnodes('/testlist/cimeroot'); - die "cannot find cimeroot!" if(! @cimeroots); - my $cimeroot = $cimeroots[0]->textContent(); - &Debug("cimeroot: $cimeroot\n"); - $expectedFailsFile = "$cimeroot/cime_config/cesm/ExpectedTestFails.xml"; - } - + # Get the expectedFailsFile. + if(! defined $expectedFailsFile) + { + my @cimeroots = $root->findnodes('/testlist/cimeroot'); + die "cannot find cimeroot!" if(! @cimeroots); + my $cimeroot = $cimeroots[0]->textContent(); + &Debug("cimeroot: $cimeroot\n"); + $expectedFailsFile = "$cimeroot/cime_config/cesm/ExpectedTestFails.xml"; + } + &Debug("caseinfo: " . eval { Dumper \%caseinfo} ); return %caseinfo; } @@ -302,7 +265,7 @@ sub getTestSuiteInfo #------------------------------------------------------------------------------- sub getTestStatus { - my ($testdirs, $tag, $testid, $xfailelems) = @_; + my ($testdirs, $tag, $testid) = @_; my %teststatushash; my %nlreporthash; my $time = localtime; @@ -332,101 +295,43 @@ sub getTestStatus open (my $teststatusfile, "<", $statusfile) or die "cannot open TestStatus file for $testcase, $!"; my $teststatus = <$teststatusfile>; chomp $teststatus; - #my $lotsacasestatus = $teststatus; my $statusline = $teststatus; $teststatus = (split(/\s+/, $teststatus))[0]; - &Debug("Testcase: $testcase\n"); - &Debug( "Teststatus: $teststatus\n"); - - my $xfailbugz; - my $xfailnode; - - #print Dumper $xfailelems; - #print "statusline: $statusline\n"; - foreach my $xfailelem(@$xfailelems) - { - my $xfailentry = $xfailelem->textContent(); - #print "xfailentry $xfailentry\n"; - #my $bugz = $xfailnode->getAttribute('bugz'); - my $bugz = undef; - if($xfailelem->hasAttribute('bugz')) - { - $bugz = $xfailelem->getAttribute('bugz'); - } - $xfailentry =~ m/(\w+\s)(.+$)/; - #print "xfailentry $xfailentry\n"; - my $xfailinfo = $2; - #print "xfailinfo: $xfailinfo\n"; - #print "statusline: $statusline\n"; - chomp($status_info); - #if(($statusline =~ m/(^$xfailinfo)(\..*$)/) || - # $xfailinfo eq $status_info) - if(($xfailinfo =~ /$testbaseid/) || - $xfailinfo eq $status_info) - { - &Debug( "match found!"); - &Debug( "xfailinfo: $xfailinfo"); - &Debug( "statusline: $statusline"); - if($teststatus =~ m/DONE/) - { - $teststatus = 'U' . $teststatus; - } - if($teststatus =~ m/PASS/) - { - $teststatus = 'U' . $teststatus; - } - - if($teststatus =~ m/(FAIL|RUN)/) - { - if($bugz) - { - $teststatus = 'KT' . $teststatus . "(bugzilla $bugz)"; - } - else - { - $teststatus = 'KT' . $teststatus ; - } - } - &Debug( "teststatus $teststatus"); - } - - } + &Debug("Teststatus: $teststatus\n"); # Now go through the TestStats getting the memleak, compare, baseline tag, throughput, and comments if any. my @statuslines = <$teststatusfile>; chomp @statuslines; - #If the 'test functionality summary' is not PASS, then report the - # test functionality summary as the teststatus field. - my @testsummarylines = grep { /test functionality summary/ } @statuslines; - my $testsummary = (split(/\s+/, $testsummarylines[0]))[0]; - if(defined $testsummary && $testsummary !~ /PASS/) - { - $teststatus = $testsummary; - $teststatushash{$testcase}{'comment'} = "Overall Test status failed! Check the history files!!"; - } - $teststatushash{$testcase}{'status'} = $teststatus; + # If the 'test functionality summary' is not PASS, then report the + # test functionality summary as the teststatus field. + my @testsummarylines = grep { /test functionality summary/ } @statuslines; + my $testsummary = (split(/\s+/, $testsummarylines[0]))[0]; + if(defined $testsummary && $testsummary !~ /PASS/) + { + $teststatus = $testsummary; + $teststatushash{$testcase}{'comment'} = "Overall Test status failed! Check the history files!!"; + } + $teststatushash{$testcase}{'status'} = $teststatus; # Get the baseline compare summary - #my @comparelines = grep { /compare_hist/} @statuslines; my @comparelines = grep { /baseline compare summary/} @statuslines; my ($comparestatus,$comparetest) = split(/\s+/, $comparelines[0]); $teststatushash{$testcase}{'compare'} = $comparestatus; my $comparetag = (split(/\./, $comparetest))[-1]; $baselinetag = $comparetag unless defined $baselinetag; - - - # If this a normal test, ie NOT a set of SBN tests, then - # send the following fields. If this is a namelist test, then skip these fields, they - # will never be filled in for SBN tests. - if($testtype ne 'namelist') + + # If this a normal test, ie NOT a set of SBN tests, then + # send the following fields. If this is a namelist test, then skip these fields, they + # will never be filled in for SBN tests. + if($testtype ne 'namelist') { my @memleaklines = grep { /memleak/ } @statuslines; my $memleakstatus = (split(/\s+/, $memleaklines[0]))[0]; $teststatushash{$testcase}{'memleak'} = $memleakstatus; - + my @memcomplines = grep { /memcomp/} @statuslines; my $memcompstatus = (split(/\s+/, $memcomplines[0]))[0]; $teststatushash{$testcase}{'memcomp'} = $memcompstatus; @@ -443,11 +348,10 @@ sub getTestStatus my @commentlines = grep { /COMMENT/ } @statuslines; my $comment = (split(/\s+/, $commentlines[0], 2) )[1]; chomp $comment; - #$teststatushash{$testcase}{'comment'} = $lotsacasestatus; $teststatushash{$testcase}{'comment'} = $comment; close $teststatusfile; - + # Check the CaseStatus, and print out the last line... my $casestatusfile = $testroot . "/" . $testcase . "/" . $casestatusfilename; if( -e $casestatusfile) @@ -462,7 +366,6 @@ sub getTestStatus close $casestatusfile; chomp $lastline; &Debug ("last line of CaseStatus: $lastline\n"); - #$teststatushash{$testcase}{'casestatus'} = $lotsacasestatus; $teststatushash{$testcase}{'casestatus'} = $lastline; } else @@ -507,7 +410,7 @@ sub getTestStatus $tputcompstatus = (split(/\s+/, $tputcomplines[0]))[0]; $teststatushash{$testcase}{'ioptputcomp'} = $tputcompstatus; - @nlcomplines = grep { /nlcomp/i } @statuslines; + @nlcomplines = grep { /nlcomp/i } @statuslines; $nlcompstatus = (split(/\s+/, $nlcomplines[0]))[0]; $teststatushash{$testcase}{'iopnlcomp'} = $nlcompstatus; @@ -521,11 +424,10 @@ sub getTestStatus close $iopfh; } - - if($testtype eq 'namelist') + if($testtype eq 'namelist') { my $statusoutfile = $testroot . "/" . $testcase . "/" . $teststatusoutfilename; - if( -e $statusoutfile && $teststatushash{$testcase}{'nlcomp'} eq 'FAIL') + if( -e $statusoutfile && $teststatushash{$testcase}{'nlcomp'} eq 'FAIL') { open my $STATUSOUT, "<", $statusoutfile or warn "can't open $statusoutfile, $!"; my @statusoutlines = <$STATUSOUT>; @@ -544,18 +446,19 @@ sub getTestStatus } $nlreporthash{$teststatushash{$testcase}{'comment'}}{$testcase} = 1; } - foreach my $blank(keys %nlreporthash) - { - delete $nlreporthash{$blank} if(length $nlreporthash{$blank} == 0); - } + } + + foreach my $blank(keys %nlreporthash) + { + delete $nlreporthash{$blank} if(length $nlreporthash{$blank} == 0); } } - + foreach my $blank(keys %nlreporthash) { delete $nlreporthash{$blank} if(length $nlreporthash{$blank} == 0); } - + return \%teststatushash, \%nlreporthash; } @@ -705,12 +608,12 @@ sub printreport sub authenticate { - print "Enter your username: \n"; - $username = ; - print "Enter your password: \n"; - system('stty','-echo'); - chop($password = ); - system('stty','echo'); - chomp $username; - chomp $password; + print "Enter your username: \n"; + $username = ; + print "Enter your password: \n"; + system('stty','-echo'); + chop($password = ); + system('stty','echo'); + chomp $username; + chomp $password; } From 4af979f8acef15d919c342eddb7a3682aeceb2ed Mon Sep 17 00:00:00 2001 From: brian-eaton Date: Wed, 17 Feb 2016 09:08:35 -0700 Subject: [PATCH 28/46] Add correct value of ATM_NCPL for T42 grid. The T42 grid was getting ATM_NCPL set to 48 which is the default for the FV dycore. The default for the Eulerian dycore at T42 is 72. Made this change in file cime/driver_cpl/cime_config/config_component.xml I ran a create_newcase command with a T42 grid and got the correct value of ATM_NCPL. Everything looks OK. Test suite: Test baseline: Test namelist changes: Test status: [bit for bit, roundoff, climate changing] Fixes: [CIME Github issue #] User interface changes?: [Yes (describe what changes), No] Code review: --- driver_cpl/cime_config/config_component.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index b52a63d3abd..9180bf8a643 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -2881,6 +2881,7 @@ 96 96 96 + 72 144 288 48 From 04165b5e293ee5f9a8f2cdd8c591dd3c917dd669 Mon Sep 17 00:00:00 2001 From: Alice Bertini Date: Wed, 17 Feb 2016 16:09:38 -0700 Subject: [PATCH 29/46] update config_batch.xml to remove pbs directives The queue and wallclock time were being set in 2 places for the PBS batch system. The case dir env_batch.xml controls the arguments to the qsub command and the config_batch.xml directive element entries are ignored in favor of the qsub command line args. Remove the redundant directive elements from the config_batch.xml file. Test suite: SMS_D_ld3.f45_g37_rc1.A.hobart_nag Test baseline: N/A Test namelist changes: N/A Test status: bit for bit Fixes: related to CIME issue #49 Code review: --- cime_config/cesm/machines/config_batch.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/cime_config/cesm/machines/config_batch.xml b/cime_config/cesm/machines/config_batch.xml index 6df36dbbe63..c0d59affab7 100644 --- a/cime_config/cesm/machines/config_batch.xml +++ b/cime_config/cesm/machines/config_batch.xml @@ -77,8 +77,6 @@ -N {{ job_id }} - -q {{ queue }} - -l walltime={{ wall_time }} -r {{ rerunnable }} -j oe From 0326776e1400ccae179de5c1805922480bbf045e Mon Sep 17 00:00:00 2001 From: Alice Bertini Date: Mon, 22 Feb 2016 17:01:44 -0700 Subject: [PATCH 30/46] update hobart pe layout for all active f19_g16 This change updates the PE layout on hobart to take advantage of running with 6 nodes, 24 pes/node for fully coupled B1850, f19_g16 validation test cases. Test suite: validation tests Test baseline: N/A Test namelist changes: N/A Test status: bit for bit Fixes: validation testing on hobart using PyCECT Code review: --- cime_config/cesm/allactive/config_pes.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cime_config/cesm/allactive/config_pes.xml b/cime_config/cesm/allactive/config_pes.xml index de567433a41..1909c173459 100644 --- a/cime_config/cesm/allactive/config_pes.xml +++ b/cime_config/cesm/allactive/config_pes.xml @@ -854,12 +854,12 @@ none - 72 - 24 - 24 - 48 + 120 + 48 + 48 + 72 24 - 72 + 120 1 1 @@ -876,8 +876,8 @@ 0 0 - 24 - 72 + 48 + 120 0 0 0 From 416e9b3502251636935fff3b1c0139fba017d0ac Mon Sep 17 00:00:00 2001 From: apcraig Date: Wed, 24 Feb 2016 12:07:14 -0700 Subject: [PATCH 31/46] Modify seq_io_mod.F90 so an avect field named "hgt" is never written to the history file. This is a temporary workaround until models initialize the hgt field in the domain datatype. The exact restart test was failing in cases where hgt was not initialized (and not used) simply because it appeared on the coupler history file and was not defined uniquely in those cases. --- driver_cpl/driver/seq_io_mod.F90 | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/driver_cpl/driver/seq_io_mod.F90 b/driver_cpl/driver/seq_io_mod.F90 index 67b3e82f9c8..16364b214d6 100644 --- a/driver_cpl/driver/seq_io_mod.F90 +++ b/driver_cpl/driver/seq_io_mod.F90 @@ -483,6 +483,8 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval, call mct_aVect_getRList(mstring,k,AV) itemc = mct_string_toChar(mstring) call mct_string_clean(mstring) +!-------tcraig, this is a temporary mod to NOT write hgt + if (trim(itemc) /= "hgt") then name1 = trim(lpre)//'_'//trim(itemc) call seq_flds_lookup(itemc,longname=lname,stdname=sname,units=cunit) if (luse_float) then @@ -501,6 +503,8 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval, rcode = pio_put_att(cpl_io_file,varid,"cell_methods","time: mean") endif endif +!-------tcraig + endif enddo if (lwdata) call seq_io_enddef(filename) end if @@ -515,11 +519,15 @@ subroutine seq_io_write_av(filename,gsmap,AV,dname,whead,wdata,nx,ny,nt,fillval, call mct_aVect_getRList(mstring,k,AV) itemc = mct_string_toChar(mstring) call mct_string_clean(mstring) +!-------tcraig, this is a temporary mod to NOT write hgt + if (trim(itemc) /= "hgt") then name1 = trim(lpre)//'_'//trim(itemc) rcode = pio_inq_varid(cpl_io_file,trim(name1),varid) call pio_setframe(cpl_io_file,varid,frame) tmpdata = av%rattr(k,:) call pio_write_darray(cpl_io_file, varid, iodesc, tmpdata, rcode, fillval=lfillvalue) +!-------tcraig + endif enddo deallocate(tmpdata) call pio_freedecomp(cpl_io_file, iodesc) @@ -677,6 +685,8 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva call mct_aVect_getRList(mstring,k,AVS(1)) itemc = mct_string_toChar(mstring) call mct_string_clean(mstring) +!-------tcraig, this is a temporary mod to NOT write hgt + if (trim(itemc) /= "hgt") then name1 = trim(lpre)//'_'//trim(itemc) call seq_flds_lookup(itemc,longname=lname,stdname=sname,units=cunit) if (luse_float) then @@ -695,6 +705,8 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva rcode = pio_put_att(cpl_io_file,varid,"cell_methods","time: mean") endif endif +!-------tcraig + endif enddo if (lwdata) call seq_io_enddef(filename) end if @@ -721,6 +733,8 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva call mct_aVect_getRList(mstring,k,AVS(1)) itemc = mct_string_toChar(mstring) call mct_string_clean(mstring) +!-------tcraig, this is a temporary mod to NOT write hgt + if (trim(itemc) /= "hgt") then name1 = trim(lpre)//'_'//trim(itemc) rcode = pio_inq_varid(cpl_io_file,trim(name1),varid) call pio_setframe(cpl_io_file,varid,frame) @@ -731,6 +745,8 @@ subroutine seq_io_write_avs(filename,gsmap,AVS,dname,whead,wdata,nx,ny,nt,fillva enddo call pio_write_darray(cpl_io_file, varid, iodesc, data, rcode, fillval=lfillvalue) call pio_setdebuglevel(0) +!-------tcraig + endif enddo deallocate(data) @@ -897,6 +913,8 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, & call mct_aVect_getRList(mstring,k,avcomp1) itemc = mct_string_toChar(mstring) call mct_string_clean(mstring) +!-------tcraig, this is a temporary mod to NOT write hgt + if (trim(itemc) /= "hgt") then name1 = trim(lpre)//'_'//trim(itemc) call seq_flds_lookup(itemc,longname=lname,stdname=sname,units=cunit) if (luse_float) then @@ -915,6 +933,8 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, & rcode = pio_put_att(cpl_io_file,varid,"cell_methods","time: mean") endif endif +!-------tcraig + endif enddo if (lwdata) call seq_io_enddef(filename) end if @@ -943,6 +963,8 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, & call mct_aVect_getRList(mstring,k,avcomp1) itemc = mct_string_toChar(mstring) call mct_string_clean(mstring) +!-------tcraig, this is a temporary mod to NOT write hgt + if (trim(itemc) /= "hgt") then name1 = trim(lpre)//'_'//trim(itemc) rcode = pio_inq_varid(cpl_io_file,trim(name1),varid) call pio_setframe(cpl_io_file,varid,frame) @@ -956,6 +978,8 @@ subroutine seq_io_write_avscomp(filename, comp, flow, dname, & enddo enddo call pio_write_darray(cpl_io_file, varid, iodesc, data, rcode, fillval=lfillvalue) +!-------tcraig + endif enddo deallocate(data) From 727cffbfcc2efea576e0de7948466555b1a20729 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Wed, 24 Feb 2016 14:04:51 -0700 Subject: [PATCH 32/46] [ 50 character, one line summary ] [ Description of the changes in this commit. It should be enough information for someone not following this development to understand. Lines should be wrapped at about 72 characters. ] Get GSWP3 option for datm namelist actually working Test suite: ./datm build-namelist_test.pl --- .../bld/namelist_files/namelist_defaults_datm.xml | 2 +- .../datm/bld/unit_testers/build-namelist_test.pl | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 4f985410bcd..810a5285634 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -171,7 +171,7 @@ Currently the following streams are supported (term definitions precede the stre CLM1PT.$ATM_GRID CLMCRUNCEP.Solar,CLMCRUNCEP.Precip,CLMCRUNCEP.TPQW CLMCRUNCEP_V5.Solar,CLMCRUNCEP_V5.Precip,CLMCRUNCEP_V5.TPQW -CLMGSWP3_V5.Solar,CLMGSWP3_V5.Precip,CLMGSWP3_V5.TPQW +CLMGSWP3.Solar,CLMGSWP3.Precip,CLMGSWP3.TPQW CORE2_NYF.GISS,CORE2_NYF.GXGXS,CORE2_NYF.NCEP CORE2_IAF.GCGCS.PREC,CORE2_IAF.GISS.LWDN,CORE2_IAF.GISS.SWDN,CORE2_IAF.GISS.SWUP,CORE2_IAF.NCEP.DN10,CORE2_IAF.NCEP.Q_10,CORE2_IAF.NCEP.SLP_,CORE2_IAF.NCEP.T_10,CORE2_IAF.NCEP.U_10,CORE2_IAF.NCEP.V_10,CORE2_IAF.CORE2.ArcFactor CORE2_IAF.NCEP.DENS.SOFS,CORE2_IAF.NCEP.PSLV.SOFS,CORE2_IAF.PREC.SOFS.DAILY,CORE2_IAF.LWDN.SOFS.DAILY,CORE2_IAF.SWDN.SOFS.DAILY,CORE2_IAF.SWUP.SOFS.DAILY,CORE2_IAF.SHUM.SOFS.6HOUR,CORE2_IAF.TBOT.SOFS.6HOUR,CORE2_IAF.U.SOFS.6HOUR,CORE2_IAF.V.SOFS.6HOUR,CORE2_IAF.CORE2.ArcFactor diff --git a/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl b/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl index a910b851ed4..5a75a17044e 100755 --- a/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl +++ b/components/data_comps/datm/bld/unit_testers/build-namelist_test.pl @@ -30,7 +30,8 @@ sub usage { EOF } # The env variables that will need to be set -my %xmlenv = ( "DATM_CO2_TSERIES", "RUN_TYPE", "DIN_LOC_ROOT", "ATM_DOMAIN_FILE", "ATM_DOMAIN_PATH", "DATM_MODE", "DATM_PRESAERO", "ATM_GRID", "GRID" ); +my %xmlenv = ( "DATM_CO2_TSERIES", "RUN_TYPE", "DIN_LOC_ROOT", "ATM_DOMAIN_FILE", "ATM_DOMAIN_PATH", "DATM_MODE", "DATM_PRESAERO", "ATM_GRID", +"GRID", "DATM_TOPO" ); my $envxmlfile = "env_utrun.xml"; # Filename to write env settings to # # Process command-line options. @@ -105,6 +106,7 @@ sub usage { $xmlenv{'ATM_GRID'} = "48x96"; $xmlenv{'GRID'} = "48x96_g37"; $xmlenv{'DATM_MODE'} = "CLMQIAN"; +$xmlenv{'DATM_TOPO'} = "observed"; $xmlenv{'DATM_PRESAERO'} = "clim_2000"; $xmlenv{'DATM_CO2_TSERIES'} = "none"; # Set some ENV vars needed for CLM_QIAN @@ -325,6 +327,11 @@ sub usage { foreach my $mode ( "CORE2_NYF", "CORE2_IAF", "CPLHIST3HrWx", "CLMCRUNCEP","CLMCRUNCEP_V5", "CLMGSWP3" ) { $xmlenv{'DATM_MODE'} = $mode; print "DATM_MODE = $xmlenv{'DATM_MODE'}\n"; + if ( $mode =~ /^CLM/ ) { + $xmlenv{'DATM_TOPO'} = "observed"; + } else { + $xmlenv{'DATM_TOPO'} = "none"; + } &writeEnv( %xmlenv ); eval{ system( "$bldnml" ); }; ok( ! $?, "mode=$mode" ); @@ -339,6 +346,7 @@ sub usage { # Run with presaero="none"; $xmlenv{'DATM_MODE'} = "CORE2_NYF"; $xmlenv{'DATM_PRESAERO'} = "none"; +$xmlenv{'DATM_TOPO'} = "none"; print "DATM_MODE = $xmlenv{'DATM_MODE'}\n"; print "DATM_PRESAERO = $xmlenv{'DATM_PRESAERO'}\n"; &writeEnv( %xmlenv ); @@ -349,6 +357,7 @@ sub usage { system( "/bin/rm -rf $confdir" ); $xmlenv{'DATM_MODE'} = "CLM_QIAN"; $xmlenv{'DATM_PRESAERO'} = "clim_2000"; +$xmlenv{'DATM_TOPO'} = "observed"; print "DATM_MODE = $xmlenv{'DATM_MODE'}\n"; print "DATM_PRESAERO = $xmlenv{'DATM_PRESAERO'}\n"; @@ -368,6 +377,7 @@ sub usage { # Bad ENV settings my %bad_env = ( CLMQIAN_N_PAERONONE =>{ DATM_MODE =>"CLM_QIAN", DATM_PRESAERO=>"none" }, + TOPONONEAND_CLM =>{ DATM_MODE =>"CLM_QIAN", DATM_TOPO =>"none" }, BAD_DATM_MODE =>{ DATM_MODE =>"zztop" }, BAD_PRESAERO =>{ DATM_PRESAERO=>"zztop" }, BAD_CQYR_RANGE =>{ DATM_CLMNCEP_YR_START=>2004, DATM_CLMNCEP_YR_END=>1948 }, From ccc56c4a98526eb7d4009162281b314a427c3e43 Mon Sep 17 00:00:00 2001 From: Katetc Date: Thu, 25 Feb 2016 12:46:23 -0700 Subject: [PATCH 33/46] Breaking up four long lines into 8 shorter ones to statisfy Nag compiler requirements. --- share/csm_share/shr/shr_strdata_mod.F90 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/share/csm_share/shr/shr_strdata_mod.F90 b/share/csm_share/shr/shr_strdata_mod.F90 index 4b7a8b9276a..218d463bee8 100644 --- a/share/csm_share/shr/shr_strdata_mod.F90 +++ b/share/csm_share/shr/shr_strdata_mod.F90 @@ -680,8 +680,10 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) if (newData(n)) then if (debug > 0) then - write(logunit,*) trim(subname),' newData RLB = ',n,minval(SDAT%avRLB(n)%rAttr),maxval(SDAT%avRLB(n)%rAttr),sum(SDAT%avRLB(n)%rAttr) - write(logunit,*) trim(subname),' newData RUB = ',n,minval(SDAT%avRUB(n)%rAttr),maxval(SDAT%avRUB(n)%rAttr),sum(SDAT%avRUB(n)%rAttr) + write(logunit,*) trim(subname),' newData RLB = ',n,minval(SDAT%avRLB(n)%rAttr), & + maxval(SDAT%avRLB(n)%rAttr),sum(SDAT%avRLB(n)%rAttr) + write(logunit,*) trim(subname),' newData RUB = ',n,minval(SDAT%avRUB(n)%rAttr), & + maxval(SDAT%avRUB(n)%rAttr),sum(SDAT%avRUB(n)%rAttr) endif call shr_cal_date2ymd(SDAT%ymdLB(n),year,month,day) call shr_cal_timeSet(timeLB,SDAT%ymdLB(n),0,SDAT%stream(n)%calendar) @@ -730,8 +732,10 @@ subroutine shr_strdata_advance(SDAT,ymd,tod,mpicom,istr,timers) endif if (debug > 0) then - write(logunit,*) trim(subname),' newData FLB = ',n,minval(SDAT%avFLB(n)%rAttr),maxval(SDAT%avFLB(n)%rAttr),sum(SDAT%avFLB(n)%rAttr) - write(logunit,*) trim(subname),' newData FUB = ',n,minval(SDAT%avFUB(n)%rAttr),maxval(SDAT%avFUB(n)%rAttr),sum(SDAT%avFUB(n)%rAttr) + write(logunit,*) trim(subname),' newData FLB = ',n,minval(SDAT%avFLB(n)%rAttr), & + maxval(SDAT%avFLB(n)%rAttr),sum(SDAT%avFLB(n)%rAttr) + write(logunit,*) trim(subname),' newData FUB = ',n,minval(SDAT%avFUB(n)%rAttr), & + maxval(SDAT%avFUB(n)%rAttr),sum(SDAT%avFUB(n)%rAttr) endif endif enddo From b3b4e0888c66906cacf327b2eb6a021c5fa45553 Mon Sep 17 00:00:00 2001 From: Alice Bertini Date: Thu, 25 Feb 2016 13:18:09 -0700 Subject: [PATCH 34/46] minor update for testing Update testreporter.pl to report teststatus as overall runtime status when it is DONE even if test functionality reports FAIL due to namelist comparison. Add ERR.f19_g16.B1850 to edison prealpha testlist. Test suite: N/A Test baseline: N/A Test namelist changes: N/A Test status: bit for bit Fixes: N/A Code review: --- cime_config/cesm/allactive/testlist_allactive.xml | 3 +++ scripts/Testing/testreporter.pl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cime_config/cesm/allactive/testlist_allactive.xml b/cime_config/cesm/allactive/testlist_allactive.xml index 0f598507e54..193d0af5bb4 100644 --- a/cime_config/cesm/allactive/testlist_allactive.xml +++ b/cime_config/cesm/allactive/testlist_allactive.xml @@ -23,6 +23,9 @@ bluewaters yellowstone + + edison + yellowstone diff --git a/scripts/Testing/testreporter.pl b/scripts/Testing/testreporter.pl index 4dcd6d1561f..183a851b3d0 100755 --- a/scripts/Testing/testreporter.pl +++ b/scripts/Testing/testreporter.pl @@ -309,7 +309,7 @@ sub getTestStatus # test functionality summary as the teststatus field. my @testsummarylines = grep { /test functionality summary/ } @statuslines; my $testsummary = (split(/\s+/, $testsummarylines[0]))[0]; - if(defined $testsummary && $testsummary !~ /PASS/) + if((defined $testsummary && $testsummary !~ /PASS/) && ($teststatus !~ /DONE/)) { $teststatus = $testsummary; $teststatushash{$testcase}{'comment'} = "Overall Test status failed! Check the history files!!"; From e9dc09b431e03bc9bdae98c2b1a6a17865d48796 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Tue, 1 Mar 2016 09:53:31 -0700 Subject: [PATCH 35/46] new treatment of user_compset, bug fix for make clean --- cime_config/cesm/machines/Makefile | 92 +++++------ scripts/Tools/case.setup | 100 +++++++----- scripts/create_newcase | 241 +++++++++++++++-------------- 3 files changed, 229 insertions(+), 204 deletions(-) diff --git a/cime_config/cesm/machines/Makefile b/cime_config/cesm/machines/Makefile index 5cd19c975b2..32fa05c5121 100644 --- a/cime_config/cesm/machines/Makefile +++ b/cime_config/cesm/machines/Makefile @@ -2,7 +2,7 @@ # Common Makefile: a framework for building all CIME components and more # # Command-line variables -# MODEL= ~ a standard macro definition, often found in the included +# MODEL= ~ a standard macro definition, often found in the included # MACFILE, used to trigger special compilation flags # Supported compilers # ibm, bgl, bgp, pgi, intel, pathscale, gnu, nag @@ -13,20 +13,20 @@ null := comma := , # Load dependency search path. -dirs := . +dirs := . dirs += $(shell cat Filepath) cpp_dirs := $(dirs) # Add INCROOT to path for Depends and Include -MINCROOT := +MINCROOT := ifdef INCROOT cpp_dirs += $(INCROOT) MINCROOT := $(INCROOT) endif # Expand any tildes in directory names. Change spaces to colons. -VPATH := $(foreach dir,$(cpp_dirs),$(wildcard $(dir))) -VPATH := $(subst $(space),:,$(VPATH)) +VPATH := $(foreach dir,$(cpp_dirs),$(wildcard $(dir))) +VPATH := $(subst $(space),:,$(VPATH)) RM := rm CP := cp @@ -35,7 +35,7 @@ exec_se: $(EXEC_SE) $(CURDIR)/Depends complib: $(COMPLIB) $(CURDIR)/Depends # Determine whether to compile threaded or not -# Set the THREADDIR for the shared build +# Set the THREADDIR for the shared build # based on the threaded build status compile_threaded = false ifeq ($(strip $(SMP)),TRUE) @@ -80,7 +80,7 @@ endif # set CPP options (must use this before any flags or cflags settings) #=============================================================================== -CPPDEFS := $(USER_CPPDEFS) -D$(OS) +CPPDEFS := $(USER_CPPDEFS) -D$(OS) # Unless DEBUG mode is enabled, use NDEBUG to turn off assert statements. ifneq ($(strip $(DEBUG)),TRUE) @@ -148,9 +148,9 @@ ifeq ($(USE_CXX), true) LD := $(MPIFC) endif endif -# Use this if LD has not already been defined. +# Use this if LD has not already been defined. ifeq ($(origin LD), default) - ifeq ($(strip $(MPILIB)),mpi-serial) + ifeq ($(strip $(MPILIB)),mpi-serial) LD := $(SFC) else LD := $(MPIFC) @@ -230,17 +230,17 @@ endif ifdef CPRE FPPDEFS := $(subst $(comma),\\$(comma),$(CPPDEFS)) - FPPDEFS := $(patsubst -D%,$(CPRE)%,$(FPPDEFS)) + FPPDEFS := $(patsubst -D%,$(CPRE)%,$(FPPDEFS)) else FPPDEFS := $(CPPDEFS) endif #=============================================================================== -# Set config args for pio and mct to blank and then enable serial +# Set config args for pio and mct to blank and then enable serial #=============================================================================== ifndef CONFIG_ARGS - CONFIG_ARGS := + CONFIG_ARGS := endif ifeq ($(MPILIB),mpi-serial) CONFIG_ARGS+= --enable-mpiserial @@ -256,7 +256,7 @@ endif # User-specified INCLDIR #=============================================================================== -INCLDIR := -I. +INCLDIR := -I. ifdef USER_INCLDIR INCLDIR += $(USER_INCLDIR) endif @@ -303,7 +303,7 @@ ifdef MOD_NETCDF endif ifdef INC_MPI INCLDIR += -I$(INC_MPI) -endif +endif ifdef INC_PNETCDF INCLDIR += -I$(INC_PNETCDF) endif @@ -359,7 +359,7 @@ endif INCLDIR += -I$(SHAREDPATH)/include -I$(CIMEROOT)/share/csm_share/shr \ -I$(CIMEROOT)/share/csm_share/include -I$(CIMEROOT)/share/shr_RandNum/include # -# Use the MCT dir for the cache for all configure calls because it is the first one +# Use the MCT dir for the cache for all configure calls because it is the first one # CFLAGS+=$(CPPDEFS) CXXFLAGS := $(CFLAGS) @@ -367,7 +367,7 @@ CXXFLAGS := $(CFLAGS) CONFIG_ARGS += CC="$(SCC)" FC="$(SFC)" MPICC="$(MPICC)" \ MPIFC="$(MPIFC)" FCFLAGS="$(FFLAGS) $(FREEFLAGS) $(INCLDIR)" \ CPPDEFS="$(CPPDEFS)" CFLAGS="$(CFLAGS) -I.. $(INCLDIR)" \ - NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" + NETCDF_PATH=$(NETCDF_PATH) LDFLAGS="$(LDFLAGS)" ifeq ($(COMPILER),nag) CONFIG_ARGS += LIBS="$(SLIBS)" endif @@ -413,9 +413,9 @@ ifdef ESMF_LIBDIR endif -# System libraries (netcdf, mpi, pnetcdf, esmf, trilinos, etc.) +# System libraries (netcdf, mpi, pnetcdf, esmf, trilinos, etc.) ifndef SLIBS - SLIBS := -L$(LIB_NETCDF) -lnetcdf + SLIBS := -L$(LIB_NETCDF) -lnetcdf endif ifdef LIB_PNETCDF SLIBS += -L$(LIB_PNETCDF) -lpnetcdf @@ -426,13 +426,13 @@ endif ifdef LIB_MPI ifndef MPI_LIB_NAME SLIBS += -L$(LIB_MPI) -lmpi - else + else SLIBS += -L$(LIB_MPI) -l$(MPI_LIB_NAME) endif endif # For compiling and linking with external ESMF. -# If linking to external ESMF library then include esmf.mk +# If linking to external ESMF library then include esmf.mk # ESMF_F90COMPILEPATHS # ESMF_F90LINKPATHS # ESMF_F90LINKRPATHS @@ -472,11 +472,11 @@ endif #------------------------------------------------------------------------------ -$(MCT_LIBDIR)/Makefile.conf: +$(MCT_LIBDIR)/Makefile.conf: @echo "SHAREDLIBROOT |$(SHAREDLIBROOT)| SHAREDPATH |$(SHAREDPATH)|"; \ $(CONFIG_SHELL) $(CIMEROOT)/externals/mct/configure $(CONFIG_ARGS) --srcdir $(CIMEROOT)/externals/mct -$(MCT_LIBDIR)/mpi-serial/Makefile.conf: +$(MCT_LIBDIR)/mpi-serial/Makefile.conf: @echo "SHAREDLIBROOT |$(SHAREDLIBROOT)| SHAREDPATH |$(SHAREDPATH)|"; \ $(CONFIG_SHELL) $(CIMEROOT)/externals/mct/mpi-serial/configure $(CONFIG_ARGS) --srcdir $(CIMEROOT)/externals/mct @@ -505,7 +505,7 @@ else endif endif -MCTLIBS = $(MCT_LIBDIR)/libmct.a $(MCT_LIBDIR)/libmpeu.a +MCTLIBS = $(MCT_LIBDIR)/libmct.a $(MCT_LIBDIR)/libmpeu.a GPTLLIB = $(GPTL_LIBDIR)/libgptl.a @@ -516,7 +516,7 @@ ULIBS += -L$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_share - #------------------------------------------------------------------------------ ifndef CMAKE_OPTS - CMAKE_OPTS := + CMAKE_OPTS := endif # note that the fortran flags include neither the FREEFLAGS nor the # FIXEDFLAGS, so that both free & fixed code can be built (cmake @@ -532,7 +532,7 @@ CMAKE_OPTS += -D CMAKE_Fortran_FLAGS:STRING="$(FFLAGS) $(INCLDIR)" \ -D USER_CMAKE_MODULE_PATH:STRING=$(CIMEROOT)/externals/CMake ifdef PNETCDF_PATH - CMAKE_OPTS += -D PNETCDF_DIR:STRING="$(PNETCDF_PATH)" + CMAKE_OPTS += -D PNETCDF_DIR:STRING="$(PNETCDF_PATH)" else CMAKE_OPTS += -D WITH_PNETCDF:LOGICAL=FALSE -D PIO_USE_MPIIO:LOGICAL=FALSE endif @@ -547,23 +547,23 @@ CMAKE_OPTS += $(USER_CMAKE_OPTS) # CMAKE_C_COMPILER, etc., when you rerun cmake with an existing # cache. So doing this via environment variables instead. ifndef CMAKE_ENV_VARS - CMAKE_ENV_VARS := + CMAKE_ENV_VARS := endif CMAKE_ENV_VARS += CC=$(CC) \ CXX=$(CXX) \ FC=$(FC) \ - LDFLAGS="$(LDFLAGS)" + LDFLAGS="$(LDFLAGS)" # We declare $(GLC_DIR)/Makefile to be a phony target so that cmake is # always rerun whenever invoking 'make $(GLC_DIR)/Makefile'; this is # desirable to pick up any new source files that may have been added -.PHONY: $(GLC_DIR)/Makefile +.PHONY: $(GLC_DIR)/Makefile $(GLC_DIR)/Makefile: cd $(GLC_DIR); \ $(CMAKE_ENV_VARS) cmake $(CMAKE_OPTS) $(CIMEROOT)/../components/cism/glimmer-cism -$(PIO_LIBDIR)/Makefile: +$(PIO_LIBDIR)/Makefile: cd $(PIO_LIBDIR); \ $(CMAKE_ENV_VARS) cmake $(CMAKE_OPTS) $(PIO_SRC_DIR) @@ -571,7 +571,7 @@ $(PIO_LIBDIR)/Makefile: # Build & include dependency files #------------------------------------------------------------------------------- -touch_filepath: +touch_filepath: touch $(CURDIR)/Filepath # Get list of files and build dependency file for all .o files @@ -580,7 +580,7 @@ touch_filepath: SOURCES := $(shell cat Srcfiles) BASENAMES := $(basename $(basename $(SOURCES))) OBJS := $(addsuffix .o, $(BASENAMES)) -INCS := $(foreach dir,$(cpp_dirs),-I$(dir)) +INCS := $(foreach dir,$(cpp_dirs),-I$(dir)) CURDIR := $(shell pwd) @@ -592,7 +592,7 @@ $(CURDIR)/Deppath: $(CURDIR)/Filepath @echo "$(MINCROOT)" >> $@ $(CURDIR)/Srcfiles: $(CURDIR)/Filepath - $(CASETOOLS)/mkSrcfiles + $(CASETOOLS)/mkSrcfiles $(CURDIR)/Filepath: @echo "$(VPATH)" > $@ @@ -640,10 +640,10 @@ ifeq ($(ULIBDEP),$(null)) ULIBDEP += $(LIBROOT)/libice.a ifeq ($(findstring clm5_0,$(CLM_CONFIG_OPTS)),clm5_0) LNDLIB := libclm.a - else + else ifeq ($(findstring clm4_5,$(CLM_CONFIG_OPTS)),clm4_5) LNDLIB := libclm.a - else + else LNDLIB := liblnd.a endif endif @@ -699,7 +699,7 @@ CSMSHARELIB = $(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/$(NINST_VALUE)/csm_shar ULIBDEP += $(CSMSHARELIB) #------------------------------------------------------------------------------- -# build rules: +# build rules: #------------------------------------------------------------------------------- .SUFFIXES: @@ -711,14 +711,14 @@ ifeq ($(MPILIB),mpi-serial) CMAKE_OPTS += -DMPI_C_INCLUDE_PATH=$(SHAREDPATH)/include \ -DMPI_Fortran_INCLUDE_PATH=$(SHAREDPATH)/include \ -DMPI_C_LIBRARIES=$(SHAREDPATH)/lib/libmpi-serial.a \ - -DMPI_Fortran_LIBRARIES=$(SHAREDPATH)/lib/libmpi-serial.a + -DMPI_Fortran_LIBRARIES=$(SHAREDPATH)/lib/libmpi-serial.a endif $(MCTLIBS) : $(MPISERIAL) $(PIOLIB) : $(MPISERIAL) $(GPTLLIB) -$(CSMSHARELIB): $(MCTLIBS) $(PIOLIB) $(GPTLLIB) +$(CSMSHARELIB): $(MCTLIBS) $(PIOLIB) $(GPTLLIB) ifneq ($(MODEL),csm_share) $(OBJS): $(CSMSHARELIB) endif @@ -726,7 +726,7 @@ endif $(EXEC_SE): $(OBJS) $(ULIBDEP) $(CSMSHARELIB) $(MCTLIBS) $(PIOLIB) $(GPTLLIB) $(LD) -o $(EXEC_SE) $(OBJS) $(CLIBS) $(ULIBS) $(SLIBS) $(MLIBS) $(LDFLAGS) -$(COMPLIB): $(OBJS) +$(COMPLIB): $(OBJS) $(AR) -r $(COMPLIB) $(OBJS) $(LIBROOT)/libcvmix.a: @@ -753,29 +753,29 @@ cleanatm: cd $(EXEROOT)/atm/obj; $(RM) -f *.o *.mod cleancpl: - cd $(EXEROOT)/drv/obj; $(RM) -f *.o *.mod + cd $(EXEROOT)/cpl/obj; $(RM) -f *.o *.mod -cleanocn: +cleanocn: $(RM) -f $(LIBROOT)/libocn.a $(LIBROOT)/libcvmix.a cd $(EXEROOT)/ocn/obj ; $(RM) -f *.o *.mod -cleanwav: +cleanwav: $(RM) -f $(LIBROOT)/libwav.a cd $(EXEROOT)/wav/obj ; $(RM) -f *.o *.mod -cleanglc: +cleanglc: $(RM) -f $(LIBROOT)/libglc.a - $(RM) -fr $(EXEROOT)/glc + $(RM) -fr $(EXEROOT)/glc -cleanice: +cleanice: $(RM) -f $(LIBROOT)/libice.a cd $(EXEROOT)/ice/obj ; $(RM) -f *.o *.mod -cleanrof: +cleanrof: $(RM) -f $(LIBROOT)/librof.a cd $(EXEROOT)/rof/obj ; $(RM) -f *.o *.mod -cleanlnd: +cleanlnd: $(RM) -f $(LIBROOT)/liblnd.a cd $(EXEROOT)/lnd/obj ; $(RM) -f *.o *.mod diff --git a/scripts/Tools/case.setup b/scripts/Tools/case.setup index 0441f750ac9..c6d03bf90c8 100755 --- a/scripts/Tools/case.setup +++ b/scripts/Tools/case.setup @@ -20,7 +20,7 @@ sub usage { SYNOPSIS Creates Macros file for target machine if it does not exist - Creates user_nl_xxx files for target components (and number of instances) if + Creates user_nl_xxx files for target components (and number of instances) if they do not exist Creates batch run script (case.run) for target machine @@ -28,10 +28,10 @@ USAGE case.setup [options] OPTIONS -help [or -h] Print usage to STDOUT. - -clean Removes the batch run script for target machine - If the testmode argument is present then keep the test + -clean Removes the batch run script for target machine + If the testmode argument is present then keep the test test script if it is present - otherwise remove it - The user_nl_xxx and Macros files are never removed by case.setup - + The user_nl_xxx and Macros files are never removed by case.setup - you must remove them manually -testmode Keeps the test script when the -clean argument is used EOF @@ -45,15 +45,15 @@ my $eol = "\n"; # Setting autoflush (an IO::Handle method) on STDOUT helps in debugging. It forces any # output be printed to STDOUT before the error messages start. -*STDOUT->autoflush(); +*STDOUT->autoflush(); # Parse command-line options. my %opts = (loglevel=>"INFO"); GetOptions( "h|help" => \$opts{'help'}, - "clean" => \$opts{'clean'}, - "testmode" => \$opts{'testmode'}, + "clean" => \$opts{'clean'}, + "testmode" => \$opts{'testmode'}, "loglevel=s" => \$opts{'loglevel'}, ) or usage(); @@ -99,7 +99,7 @@ SetupTools::getxmlvars($caseroot, \%xmlvars); my $din_loc_root = $xmlvars{'DIN_LOC_ROOT'}; my $testcase = $xmlvars{'TESTCASE'}; if (! -d $din_loc_root) { - if ($testcase ne 'SBN') { + if ($testcase ne 'SBN') { $logger->logdie( "ERROR case.setup: inputdata root is not a directory: \"$din_loc_root\" "); } } @@ -124,7 +124,7 @@ foreach my $attr (keys %xmlvars) { } $xmlvars{$attr} = SetupTools::expand_xml_var($xmlvars{$attr}, \%xmlvars); } -if ($fail_setup) { +if ($fail_setup) { my $outstr; $outstr = "$strmacros\n" if(defined($strmacros)); $outstr .= "$strbuild\n" if(defined($strbuild)); @@ -134,7 +134,7 @@ if ($fail_setup) { } #----------------------------------------------------------------------------------------------- -# Create batch script +# Create batch script #----------------------------------------------------------------------------------------------- if (! $clean ) { @@ -156,7 +156,7 @@ if (! $clean ) { SetupTools::set_compiler("$xmlvars{OS}", "$xmlvars{MACHDIR}/config_compilers.xml", "$xmlvars{COMPILER}", - "$xmlvars{MACH}", + "$xmlvars{MACH}", "$xmlvars{MPILIB}", 'Macros' ); } else { $logger->info( "Macros script already created ...skipping"); @@ -168,12 +168,12 @@ if (! $clean ) { $xmlvars{$attr}=1; my $sysmod = "./xmlchange -noecho -file env_mach_pes.xml -id $attr -val 1"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); - + } } } - my $ninst_fail = 0; + my $ninst_fail = 0; my $build_threaded = $xmlvars{BUILD_THREADED}; foreach my $comp (qw(ATM LND ROF OCN ICE GLC WAV)){ my $ninst = "NINST_".$comp; @@ -203,15 +203,16 @@ if (! $clean ) { $logger->info( "Machine/Decomp/Pes configuration has already been done ...skipping "); } else { - + _check_pelayouts_require_rebuild(); + unlink("LockedFiles/env_build.xml") if(-e "LockedFiles/env_build.xml"); my $sysmod = "./Tools/check_lockedfiles -cimeroot $cimeroot"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); - + my $pestot = `$caseroot/Tools/taskmaker.pl -sumonly`; $sysmod = "./xmlchange -noecho -file env_mach_pes.xml -id TOTALPES -val $pestot"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); wait; - + # Compute cost based on PE count my $pval = 1; my $pcnt = 0; @@ -226,7 +227,7 @@ if (! $clean ) { my $dcost = 0; if ($xmlvars{'DEBUG'} == "TRUE") {$dcost = 3;} - # Compute cost based on run length + # Compute cost based on run length # For simplicity, we use a heuristic just based on STOP_OPTION (not considering # STOP_N), and only deal with options longer than ndays my $lcost = 0; @@ -238,13 +239,13 @@ if (! $clean ) { # N years costs 365x as much as N days; since cost is based on log-base-2, add 9 $lcost = 9; } - + my $CCSM_CCOST = $xmlvars{'CCSM_CCOST'}; my $CCSM_GCOST = $xmlvars{'CCSM_GCOST'}; my $CCSM_TCOST = $xmlvars{'CCSM_TCOST'}; my $CCSM_MCOST = $xmlvars{'CCSM_MCOST'}; my $estcost = $CCSM_CCOST + $CCSM_GCOST + $CCSM_MCOST + $CCSM_TCOST + $pcost + $dcost + $lcost; - + my $sysmod = "./xmlchange -noecho -file env_mach_pes.xml -id TOTALPES -val $pestot"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); @@ -253,7 +254,7 @@ if (! $clean ) { $sysmod = "./xmlchange -noecho -file env_mach_pes.xml -id CCSM_ESTCOST -val $estcost"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); - + #-------------------------------------------------------------- # create batch file #-------------------------------------------------------------- @@ -272,7 +273,7 @@ if (! $clean ) { ); - + my $inputbatchscript = "$xmlvars{'MACHDIR'}/template.cesmrun"; my $outputbatchscript = "$xmlvars{'CASEROOT'}/case.run"; @@ -286,8 +287,8 @@ if (! $clean ) { $batchmaker->overrideNodeCount(1); $batchmaker->set({job=>'lt_archive'}); $batchmaker->makeBatchScript("$xmlvars{'MACHDIR'}/template.lt_archive", "$xmlvars{'CASEROOT'}/case.lt_archive"); - - # Make a copy of env_mach_pes.xml in order to be able + + # Make a copy of env_mach_pes.xml in order to be able # to check that it does not change once case.setup is invoked if (! -e "LockedFiles/env_mach_pes.xml") { $sysmod = "cp env_mach_pes.xml LockedFiles/env_mach_pes.xml"; @@ -295,7 +296,7 @@ if (! $clean ) { $logger->info("Locking file env_mach_pes.xml "); } } - + #-------------------------------------------------------------------------- # Create user_nl files for the required number of instances #-------------------------------------------------------------------------- @@ -347,9 +348,9 @@ if (! $clean ) { $fh->close(); } - + #----------------------------------------------------------------------------------------------- -# Clean batch script +# Clean batch script #----------------------------------------------------------------------------------------------- if ($clean) { @@ -359,9 +360,9 @@ if ($clean) { $logger->info("clean option has already been invoked ...skipping "); exit; } - + my $sysmod; - my $id = `date +%y%m%d-%H%M%S`; + my $id = `date +%y%m%d-%H%M%S`; my $backupdir = "PESetupHist/b.${id}"; if (!-d ${backupdir}) { $sysmod = "mkdir -p ${backupdir}"; @@ -375,19 +376,12 @@ if ($clean) { $sysmod = "rm ./case.run"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); - # remove relevant files from $caseroot/LockedFiels - my @files = <${caseroot}/LockedFiles/*build* ${caseroot}/LockedFiles/*mach_pes*>; - foreach my $file (@files) { - $sysmod = "rm $file"; - system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); - } - # only do the following if are NOT in testmode if (! $testmode) { # rebuild the models (even on restart) $sysmod = "./xmlchange -noecho -file env_build.xml -id BUILD_COMPLETE -val FALSE"; system($sysmod) == 0 or $logger->logdie("ERROR case.setup: $sysmod failed: $?"); - + # backup and then clean test script if( -e "$caseroot/case.test") { $sysmod = "cp case.test ${backupdir}"; @@ -410,6 +404,34 @@ if ($clean) { } +sub _check_pelayouts_require_rebuild { + my ($xmlvars) = @_; + if ( -e "LockedFiles/env_mach_pes.xml") { + # Look to see if $comp_PE_CHANGE_REQUIRES_REBUILD is defined for any component + foreach my $comp (qw(ATM LND ROF OCN ICE GLC WAV)){ + if(defined $xmlvars{$comp."_PE_CHANGE_REQUIRES_REBUILD"} && + $xmlvars{$comp."_PE_CHANGE_REQUIRES_REBUILD"} == "true"){ + # Changing these values in env_mach_pes.xml will force you to clean the corresponding component + my $old_tasks = `./xmlquery NTASKS_$comp -file LockedFiles/env_mach_pes.xml -value`; + my $old_threads = `./xmlquery NTHRDS_$comp -file LockedFiles/env_mach_pes.xml -value`; + my $old_inst = `./xmlquery NINST_$comp -file LockedFiles/env_mach_pes.xml -value`; + my $new_tasks = `./xmlquery NTASKS_$comp -file env_mach_pes.xml -value`; + my $new_threads = `./xmlquery NTHRDS_$comp -file env_mach_pes.xml -value`; + my $new_inst = `./xmlquery NINST_$comp -file env_mach_pes.xml -value`; + if($old_tasks != $new_tasks || $old_threads != $new_threads || $old_inst != $new_inst){ + $logger->warn("$comp pe change requires clean build"); + my $cleanflag = lc substr($comp,0,1); + system("./case.clean_build -$cleanflag"); + } + } + } + unlink("LockedFiles/env_mach_pes.xml"); + } + +} + + + #----------------------------------------------------------------------------------------------- sub _build_usernl_files { # Create user_nl_xxx files @@ -419,7 +441,7 @@ sub _build_usernl_files { my $file = `./xmlquery CONFIG_${model}_FILE -value`; my $dir = dirname($file); - (-d $dir) or $logger->logdie("ERROR _build_user_nl_files: cannot find cime_config directory $dir for component $comp"); + (-d $dir) or $logger->logdie("ERROR _build_user_nl_files: cannot find cime_config directory $dir for component $comp"); if ($comp eq 'cpl') { if ( ! -f "$caseroot/user_nl_cpl" ) { @@ -427,7 +449,7 @@ sub _build_usernl_files { system($sysmod) == 0 or $logger->logdie("ERROR build_usernl_files: $sysmod failed: $?"); } } else { - my $NINST = `./xmlquery NINST_${model} -value`; + my $NINST = `./xmlquery NINST_${model} -value`; if ( -f "${dir}/user_nl_${comp}") { if ($NINST > 1) { my $inst_string; @@ -445,7 +467,7 @@ sub _build_usernl_files { (-f "${dir}/user_nl_${comp}") or $logger->logdie("ERROR _build_usernl_files: $dir/user_nl_${comp} does not exist"); my $sysmod = "cp $dir/user_nl_${comp} $caseroot/user_nl_${comp}"; system($sysmod) == 0 or $logger->logdie("ERROR _build_usernl_files: $sysmod failed: $?"); - } + } } } } diff --git a/scripts/create_newcase b/scripts/create_newcase index 7066b8037ad..0211e974b33 100755 --- a/scripts/create_newcase +++ b/scripts/create_newcase @@ -1,4 +1,4 @@ -#!/usr/bin/env perl +#!/usr/bin/env perl #----------------------------------------------------------------------------------------------- # # create_newcase @@ -7,14 +7,14 @@ # options via a commandline interface. # # A few notes for clarification: -# - All possible compset components will contain a cime_config directory containing -# a file "config_component.xml" specifying the xml variable definitions for that component +# - All possible compset components will contain a cime_config directory containing +# a file "config_component.xml" specifying the xml variable definitions for that component # - If the atmopsheric component was datm, then $file would be # $cimeroot/components/data_comps/datm/cime_config/config_component.xml # note that for CESM, the only primary components are # cam, clm, cice, cism, pop, drv, allactive # so the directories for the primary components will contain the additional two files: -# 'compsets.xml', 'pelayouts.xml' and 'pio_settings.xml' +# 'compsets.xml', 'pelayouts.xml' and 'pio_settings.xml' # #----------------------------------------------------------------------------------------------- @@ -28,8 +28,8 @@ use Data::Dumper; use File::Basename; use File::Path qw(mkpath); -# Check for the existence of XML::LibXML in whatever perl distribution happens to be in use. -# If not found, print a warning message then exit. +# Check for the existence of XML::LibXML in whatever perl distribution happens to be in use. +# If not found, print a warning message then exit. eval { require XML::LibXML; XML::LibXML->import(); @@ -38,9 +38,9 @@ if($@) { my $warning = <autoflush(); +*STDOUT->autoflush(); #----------------------------------------------------------------------------------------------- # Set the directory that contains the CIME configuration scripts. If the create_newcase command was @@ -63,7 +63,7 @@ my $ProgDir = $1; # name of directory containing this scrip # the user's PATH my $cwd = getcwd(); # current working directory my $cfgdir; # absolute pathname of directory that contains this script -if ($ProgDir) { +if ($ProgDir) { $cfgdir = abs_path($ProgDir); } else { $cfgdir = $cwd; @@ -110,7 +110,7 @@ OPTIONS -mach_dir Specify the locations of the Machines directory (optional). default: \$cimeroot/machines -user_mods_dir Path to directory with user_nl_* files and xmlchange - commands to utilize (optional). For non-test cases, this + commands to utilize (optional). For non-test cases, this can also include SourceMods -confopts Specify some additional configuration options (optional) as follows: _AOA = aoflux on atm grid @@ -118,34 +118,34 @@ OPTIONS _CG = gregorian calendar _D = debug _E = esmf interfaces - _IOP* = PnetCDF IO test where * is A(atm), C(cpl), G(glc), + _IOP* = PnetCDF IO test where * is A(atm), C(cpl), G(glc), I(ice), L(lnd), O(ocn), W(wav) or blank (all components) - _L* = set run length y, m, d, h, s, n(nsteps) plus integer - (ie _Lm6 for 6 months) + _L* = set run length y, m, d, h, s, n(nsteps) plus integer + (ie _Lm6 for 6 months) _M* = set the mpilib where * is default, mpi-serial, mpich, etc _N* = set NINST_ env value to * where * is an integer - _P* = set pecount to specific values include + _P* = set pecount to specific values include T,S,M,L,X,1,1x1,16,16x1,4x4,16x1D, etc - -petype Valid values are [threaded | mpionly] + -petype Valid values are [threaded | mpionly] Force pes to be all threaded or all mpi default: this is not set - -pecount Value of S,M,L,X1,X2 (optional). + -pecount Value of S,M,L,X1,X2 (optional). default: M, partially redundant with confopts _P -user_compset Long name for new user compset to use (optional) - This assumes that all of the compset settings in the + This assumes that all of the compset settings in the long name have been defined in cime_config/config_compsets.xml -user_grid_file Full pathname of grid file to use (optional) This should be a "copy" of cime_config/config_grids.xml with the new user grid changes added to it - -user_pes_setby Component that sets the pe-layouts and pio settings + -user_pes_setby Component that sets the pe-layouts and pio settings For CESM this is [allactive, cam, clm, cice, cism, pop] -help [or -h] Print usage to STDOUT (optional). -testlist List valid values for tests [normally only invoked by create_test] (optional). -silent [or -s] Turns on silent mode - only fatal messages issued (optional). -verbose [or -v] Turn on verbose echoing of settings made by create_newcase (optional). - -xmlmode Sets format of xml files; normal or expert (optional). (default is normal) + -xmlmode Sets format of xml files; normal or expert (optional). (default is normal) -nowarning Turns off checking of the known_problems repository. (default is on) - -sharedlibroot Used for re-using build components when building multiple cases, + -sharedlibroot Used for re-using build components when building multiple cases, default is \$EXEROOT EXAMPLES @@ -171,9 +171,9 @@ GetOptions( "case=s" => \$opts{'case'}, "compset=s" => \$opts{'compset'}, "confopts=s" => \$opts{'confopts'}, - "project=s" => \$opts{'project'}, - "compiler=s" => \$opts{'compiler'}, - "mpilib=s" => \$opts{'mpilib'}, + "project=s" => \$opts{'project'}, + "compiler=s" => \$opts{'compiler'}, + "mpilib=s" => \$opts{'mpilib'}, "res=s" => \$opts{'res'}, "h|help" => \$opts{'help'}, "loglevel=s" => \$opts{'loglevel'}, @@ -182,7 +182,7 @@ GetOptions( "model=s" => \$opts{'model'}, "pecount=s" => \$opts{'pecount'}, "petype=s" => \$opts{'petype'}, - "pes_file=s" => \$opts{'pes_file'}, + "pes_file=s" => \$opts{'pes_file'}, "testname=s" => \$opts{'testname'}, "testlist" => \$opts{'testlist'}, "xmlmode=s" => \$opts{'xmlmode'}, @@ -210,12 +210,12 @@ unshift @INC, @dirs; require ConfigCase; require ConfigCompsetGrid; require ConfigPes; -require ConfigMachine; +require ConfigMachine; require ConfigTests; require SetupTools; require Project::ProjectTools; require UserMods::UserModsTools; -require Testing::TestLists; +require Testing::TestLists; require Module::ModuleLoader; require Log::Log4perl; @@ -233,7 +233,7 @@ my $caseroot; # set in _check_input_options my $grid; # set in _check_input_options my $compset; # set in _check_input_options my $compiler; # set in _check_input_options -my $confopts; # set in _set_confopts +my $confopts; # set in _set_confopts my $mach_dir; my $machine; my $testname; @@ -257,7 +257,7 @@ _check_input_options (); #------------------------------------------------------------------------------------------ # *** Set hard-wired paths *** #------------------------------------------------------------------------------------------ -my $srcroot = abs_path("$cimeroot/../"); +my $srcroot = abs_path("$cimeroot/../"); #------------------------------------------------------------------------------------------ # *** Set master config file *** @@ -274,34 +274,37 @@ my $config = ConfigCase->new(""); # Add all the elements of the config_files.xml to $config $config->add_config_variables($files_spec_file, $srcroot, $cimeroot, $model); -# Determine the driver_cpl config_component.xml file +# Determine the driver_cpl config_component.xml file my $file = $config->get('CONFIG_DRV_FILE'); # Add all the elements of the driver_cpl/cime_config/config_component.xml to $config $config->add_config_variables($file, $srcroot, $cimeroot, $model); -$config->set('CIMEROOT', $cimeroot); -$config->set('SRCROOT' , $srcroot); -$config->set('MODEL' , $model); +$config->set('CIMEROOT', $cimeroot); +$config->set('SRCROOT' , $srcroot); +$config->set('MODEL' , $model); # Determine compset longname and component that sets pe-layouts, compsets and pio settings ($pes_setby) my ($pes_setby, $compsets_file, $compset_longname, $support_level); if ($opts{'user_compset'}) { - $compset_longname = $opts{'user_compset'}; - $pes_setby = $opts{'user_pes_setby'}; - $config->set('COMPSET',$compset_longname); + $compset = $opts{'user_compset'}; } else { if (! $opts{'compset'}) { $logger->logdie ("ERROR: must set the -compset option to create_newcase "); } - #TODO - add support_level to config and query it here - ($pes_setby, $support_level) = ConfigCompsetGrid::getCompsetLongname($files_spec_file, $compset, $config); - $compset_longname = $config->get('COMPSET'); +} +#TODO - add support_level to config and query it here +($pes_setby, $support_level) = ConfigCompsetGrid::getCompsetLongname($files_spec_file, $compset, $config); +$compset_longname = $config->get('COMPSET'); +if($opts{'user_compset'}){ + if($compset_longname ne $compset or $pes_setby ne $opts{'user_pes_setby'}){ + $logger->logdie("Could not resolve user compset $compset"); + } } # Now given the target component, determine the full pathname of the file that # defines the compsets for this target component my $xml = XML::LibXML->new( no_blanks => 1)->parse_file("$files_spec_file"); -foreach my $id ('PES_SPEC_FILE', 'PIO_SPEC_FILE', 'TESTS_SPEC_FILE', 'TESTS_MOD_DIRS') { +foreach my $id ('PES_SPEC_FILE', 'PIO_SPEC_FILE', 'TESTS_SPEC_FILE', 'TESTS_MOD_DIRS') { my @nodes = $xml->findnodes(".//entry[\@id=\"$id\"]/values/value[\@component=\"$pes_setby\"]"); if (@nodes) { my $value = $nodes[0]->textContent(); @@ -329,7 +332,7 @@ foreach my $element (@elements) { # Given the compset components, determine the full pathname of each component definition file # (all have the generic name config_component.xml) and the directories each component's buildlib and buildnml files -foreach my $comp ('ATM', 'LND', 'ROF', 'ICE', 'OCN', 'GLC', 'WAV', 'DRV') { +foreach my $comp ('ATM', 'LND', 'ROF', 'ICE', 'OCN', 'GLC', 'WAV', 'DRV') { FOUND1: foreach my $component (@compset_components) { my $name = "CONFIG_" . $comp . "_FILE"; my @nodes = $xml->findnodes(".//entry[\@id=\"$name\"]/values/value[\@component=\"$component\"]"); @@ -357,7 +360,7 @@ foreach my $comp ('ATM', 'LND', 'ROF', 'ICE', 'OCN', 'GLC', 'WAV', 'DRV') { } # Overwrite the non-default values for the following config elements (needed for the calls below) -my $username = "$ENV{'USER'}"; +my $username = "$ENV{'USER'}"; $config->set('USER' , "$username"); $config->set('CASEROOT' , "$caseroot"); $config->set('CASETOOLS' , "$caseroot/Tools"); @@ -368,13 +371,13 @@ $config->set('UTILROOT' , "$cimeroot/scripts/Tools"); $config->set('SRCROOT' , "$srcroot"); #------------------------------------------------------------------------------------------ -# *** Options for listing (exit after listing) +# *** Options for listing (exit after listing) #------------------------------------------------------------------------------------------ if ($opts{'testlist'}) { my $tests_file = $config->get('TESTS_SPEC_FILE'); ConfigTests::listTests("$tests_file"); exit; -} +} #------------------------------------------------------------------------------------------ # *** Determine grid settings @@ -386,7 +389,7 @@ if (defined $opts{'user_grid_file'}){ (-f "$file") or $logger->logdie ("** ERROR create_newcase: cannot find user specified grids file $file **\n"); $config->set('GRIDS_SPEC_FILE', "$file"); } -my $grid_longname = ConfigCompsetGrid::getGridLongname($grid, $config); +my $grid_longname = ConfigCompsetGrid::getGridLongname($grid, $config); $config->set('GRID', "$grid_longname"); # Set grid component domains and mapping files @@ -395,15 +398,15 @@ ConfigCompsetGrid::setGridDomain($file, $config); ConfigCompsetGrid::setGridMaps($file, $config); #------------------------------------------------------------------------------------------ -# *** Determine compset component configurations +# *** Determine compset component configurations #------------------------------------------------------------------------------------------ # Loop over the component files (i.e. definitions_component.xml files) # determined by the compsets of the target component my @setup_comp_files; -foreach my $name ('CONFIG_ATM_FILE', 'CONFIG_ICE_FILE', 'CONFIG_GLC_FILE', 'CONFIG_LND_FILE', +foreach my $name ('CONFIG_ATM_FILE', 'CONFIG_ICE_FILE', 'CONFIG_GLC_FILE', 'CONFIG_LND_FILE', 'CONFIG_ROF_FILE', 'CONFIG_OCN_FILE', 'CONFIG_WAV_FILE') { - my $file = $config->get($name); + my $file = $config->get($name); (-f $file) || die "ERROR create_newcase: config_file $file does not exist"; $config->add_config_variables($file, $srcroot, $cimeroot); ConfigCompsetGrid::setComponent($file, $config); @@ -459,18 +462,18 @@ ConfigPes::setPes($pecount, $pes_setby, \%opts, $config); # which must be set to 1 when GLC is CISM1 my $file = $config->get('CONFIG_DRV_FILE'); -ConfigCompsetGrid::setComponent($file, $config); +ConfigCompsetGrid::setComponent($file, $config); #------------------------------------------------------------------------------------------ # Determine settings in config_compsets.xml #------------------------------------------------------------------------------------------ # This determines driver_cpl/cime_config/config_component.xml settings that are compset specific # and also check that compset is supported for target grid -# Note- this needs to come last since it will overwrite any values set above +# Note- this needs to come last since it will overwrite any values set above + + +ConfigCompsetGrid::setCompsetGeneralVars($config); -if (!$opts{'user_compset'}) { - ConfigCompsetGrid::setCompsetGeneralVars($config); -} # Special case - if land and river grids are different AND there is no mapping file # between land and river then set the river mode to null if the river component is rtm @@ -479,14 +482,14 @@ if ($rof_comp eq 'rtm' || $rof_comp eq 'mosart') { my $lnd_grid = $config->get('LND_GRID'); my $rof_grid = $config->get('ROF_GRID'); my $map_lnd2rof = $config->get('LND2ROF_FMAPNAME'); - + if (($lnd_grid ne $rof_grid) && ($map_lnd2rof eq 'idmap')) { $logger->warn("No lnd2rof_fmapname exists - RTM/MOSART mode set to null \n"); if ($rof_comp eq 'rtm') { - $config->set('RTM_MODE', 'NULL'); + $config->set('RTM_MODE', 'NULL'); } if ($rof_comp eq 'mosart') { - $config->set('MOSART_MODE', 'NULL'); + $config->set('MOSART_MODE', 'NULL'); } } } @@ -512,10 +515,10 @@ my $file = $config->get('GRIDS_SPEC_FILE'); ConfigCompsetGrid::printGridCompsetInfo($file, $config); if(defined $compset){ - $logger->info( "Compset specifier: $compset. \nLongname: $compset_longname"); - $logger->info( "Grid is valid for this compset. "); + $logger->info( "Compset specifier: $compset. \nLongname: $compset_longname"); + $logger->info( "Grid is valid for this compset. "); }else{ - $logger->info( "Compset specifier: $compset_longname."); + $logger->info( "Compset specifier: $compset_longname."); } #------------------------------------------------------------------------------------------ @@ -574,7 +577,7 @@ unless(defined $testname && $testname eq "SBN"){ $config->set('PROJECT',$project); } #------------------------------------------------------------------------------------------ -# *** Set the mpi library +# *** Set the mpi library #------------------------------------------------------------------------------------------ _set_mpi_library($mpilib, $config); @@ -603,7 +606,7 @@ if ($user_mods_dir) { # relative path specified my $user_mods_path = $config->get('USER_MODS_DIR', 'component', $pes_setby); $user_mods_dir = "$user_mods_path/$user_mods_dir"; - } + } my $is_test = 0; if ($testname) {$is_test = 1;} @@ -638,7 +641,7 @@ sub _check_input_options if (-d $case) { $logger->logdie("Case directory $case already exists "); } - mkpath($case); + mkpath($case); $caseroot = abs_path("$case"); my @dirs = split "/", $caseroot, -1; # The -1 prevents split from stripping trailing nulls @@ -786,14 +789,14 @@ sub _set_mpi_library my $mpilibs = $config->get('MPILIBS'); my @mpilibs = split ",", $mpilibs, -1; - if ($mpilib =~ 'unset') + if ($mpilib =~ 'unset') { if ($config->get('NTASKS_ATM') == 1 && $config->get('NTASKS_LND') == 1 && $config->get('NTASKS_OCN') == 1 && $config->get('NTASKS_ICE') == 1 && $config->get('NTASKS_ROF') == 1 && $config->get('NTASKS_GLC') == 1 && - $config->get('NTASKS_WAV') == 1 && $config->get('NTASKS_CPL') == 1) - { - $mpilib = "mpi-serial"; + $config->get('NTASKS_WAV') == 1 && $config->get('NTASKS_CPL') == 1) + { + $mpilib = "mpi-serial"; }else{ my $compiler = $config->get('COMPILER'); $mpilib = "openmpi" if($compiler eq "nag"); @@ -820,7 +823,7 @@ sub _set_mpi_library }else{ $mpilib = $mpilibs[0]; } - } + } $config->set('MPILIB', "$mpilib"); $logger->info( "Machine mpilib specifier: $mpilib."); } @@ -840,7 +843,7 @@ sub _create_caseroot # Create relevant directories in $caseroot my @newdirs = qw(. SourceMods LockedFiles Buildconf Tools); foreach my $newdir ( @newdirs ) { - mkpath($newdir); + mkpath($newdir); } # Open a new README.case file in $caseroot @@ -849,12 +852,12 @@ sub _create_caseroot print $fh "$commandline\n\n\n"; $fh->close; - # Copy README/disclaimer file + # Copy README/disclaimer file #TODO - this needs to be updated #$sysmod = "cp $cimeroot/scripts/README $caseroot/README.science_support"; #system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); - _create_caseroot_sourcemods($config); + _create_caseroot_sourcemods($config); _create_caseroot_tools($config); _create_caseroot_files($config); } @@ -871,24 +874,24 @@ sub _create_caseroot_tools my $sysmod; my @files = ( - "$cimeroot/scripts/Tools/case.setup", - "$cimeroot/scripts/Tools/testcase.setup", - "$cimeroot/scripts/Tools/check_input_data", - "$cimeroot/scripts/Tools/archive_metadata.sh", - "$cimeroot/scripts/Tools/check_case", - "$cimeroot/scripts/Tools/create_production_test", - "$cimeroot/scripts/Tools/st_archive", + "$cimeroot/scripts/Tools/case.setup", + "$cimeroot/scripts/Tools/testcase.setup", + "$cimeroot/scripts/Tools/check_input_data", + "$cimeroot/scripts/Tools/archive_metadata.sh", + "$cimeroot/scripts/Tools/check_case", + "$cimeroot/scripts/Tools/create_production_test", + "$cimeroot/scripts/Tools/st_archive", "$cimeroot/scripts/Tools/xmlchange", "$cimeroot/scripts/Tools/xmlquery", - "$cimeroot/scripts/Tools/README.post_process", - ); + "$cimeroot/scripts/Tools/README.post_process", + ); foreach my $file (@files) { - $sysmod = "cp -p $file $caseroot"; + $sysmod = "cp -p $file $caseroot"; system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); } $sysmod = "chmod u+w $caseroot/create_production_test"; system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); - + my $machines_file = $config->get('MACHINES_SPEC_FILE'); my $machines_dir = dirname($machines_file); @@ -898,19 +901,19 @@ sub _create_caseroot_tools } else { $logger->warn("\nUsing UNSUPPORTED userdefined mkbatch script: \"~/.cime/mkbatch.$machine\""); } - + # Copy relevant files into $caseroot/Tools/ - @files = ("$cimeroot/scripts/Tools/check_lockedfiles", - "$cimeroot/scripts/Tools/lt_archive.sh", - "$cimeroot/scripts/Tools/getTiming", + @files = ("$cimeroot/scripts/Tools/check_lockedfiles", + "$cimeroot/scripts/Tools/lt_archive.sh", + "$cimeroot/scripts/Tools/getTiming", "$cimeroot/scripts/Tools/compare_namelists.pl", - "$machines_dir/taskmaker.pl", + "$machines_dir/taskmaker.pl", "$machines_dir/Makefile", - "$machines_dir/mkSrcfiles", - "$machines_dir/mkDepends"); - + "$machines_dir/mkSrcfiles", + "$machines_dir/mkDepends"); + foreach my $file (@files) { - $sysmod = "cp -p $file $caseroot/Tools/. "; + $sysmod = "cp -p $file $caseroot/Tools/. "; system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); } } @@ -941,30 +944,30 @@ sub _create_caseroot_files system ($sysmod); if ($? == -1) {die "$sysmod failed: $!\n";} $sysmod = "chmod 755 $caseroot/case.build"; system ($sysmod); if ($? == -1) {die "$sysmod failed: $!\n";} - + # Create case.clean_build - $sysmod = "cp $cimeroot/scripts/Tools/clean_build $caseroot/case.clean_build"; + $sysmod = "cp $cimeroot/scripts/Tools/clean_build $caseroot/case.clean_build"; system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); - + # Create case.submit - $sysmod = "cp $cimeroot/scripts/Tools/case.submit $caseroot/case.submit"; + $sysmod = "cp $cimeroot/scripts/Tools/case.submit $caseroot/case.submit"; system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); # Create machine specific module files (env_mach_specific) my $dbug = $config->get("DEBUG"); - my $moduleloader = Module::ModuleLoader->new(machine => $machine, - compiler => $compiler, - mpilib => $mpilib, - debug => $dbug, - caseroot => $caseroot, + my $moduleloader = Module::ModuleLoader->new(machine => $machine, + compiler => $compiler, + mpilib => $mpilib, + debug => $dbug, + caseroot => $caseroot, cimeroot => $cimeroot, model => $model); $moduleloader->moduleInit(); $moduleloader->writeXMLFileForCase(); # Create $caseroot preview_namelist file - my $file = "${caseroot}/preview_namelists"; - $sysmod = "cp $cimeroot/scripts/Tools/preview_namelists $file"; + my $file = "${caseroot}/preview_namelists"; + $sysmod = "cp $cimeroot/scripts/Tools/preview_namelists $file"; system($sysmod) == 0 or $logger->logdie( "ERROR: $sysmod failed: $?\n"); $sysmod = "chmod 755 $file"; @@ -987,7 +990,7 @@ sub _create_caseroot_files $logger->info( "Created $caseroot/env_case.xml "); # Create env_mach_pes.xml.xml - $config->write_file("$caseroot/env_mach_pes.xml", "$file", $caseroot, $cimeroot ); + $config->write_file("$caseroot/env_mach_pes.xml", "$file", $caseroot, $cimeroot ); $logger->info( "Created $caseroot/env_mach_pes.xml "); # Create env_build.xml @@ -999,7 +1002,7 @@ sub _create_caseroot_files $logger->info( "Created $caseroot/env_run.xml "); # Create env_archive.xml - $config->write_file("$caseroot/env_archive.xml", "$file", $caseroot, $cimeroot, + $config->write_file("$caseroot/env_archive.xml", "$file", $caseroot, $cimeroot, "$cimeroot/cime_config/${model}/archive.xml"); $logger->info( "Created $caseroot/env_archive.xml "); @@ -1009,7 +1012,7 @@ sub _create_caseroot_files # copy env_case.xml in to locked files - $sysmod = "cp $caseroot/env_case.xml $caseroot/LockedFiles/env_case.xml"; + $sysmod = "cp $caseroot/env_case.xml $caseroot/LockedFiles/env_case.xml"; system($sysmod) == 0 or $logger->logdie( "ERROR: create_newcase $sysmod failed: $?"); $logger->info( "Locking file $caseroot/env_case.xml "); @@ -1027,22 +1030,22 @@ sub _create_caseroot_files #------------------------------------------------------------------------------- sub _create_caseroot_sourcemods { - my ($config) = @_; + my ($config) = @_; my $caseroot = $config->get('CASEROOT'); my $cimeroot = $config->get('CIMEROOT'); - my $comps_atm = $config->get("COMP_ATM"); - my $comps_lnd = $config->get("COMP_LND"); - my $comps_ocn = $config->get("COMP_OCN"); - my $comps_ice = $config->get("COMP_ICE"); - my $comps_glc = $config->get("COMP_GLC"); - my $comps_rof = $config->get("COMP_ROF"); + my $comps_atm = $config->get("COMP_ATM"); + my $comps_lnd = $config->get("COMP_LND"); + my $comps_ocn = $config->get("COMP_OCN"); + my $comps_ice = $config->get("COMP_ICE"); + my $comps_glc = $config->get("COMP_GLC"); + my $comps_rof = $config->get("COMP_ROF"); my $comps_wav = $config->get("COMP_WAV"); - my @comps = ($comps_atm, $comps_lnd, $comps_ocn, $comps_ice, $comps_glc, $comps_rof, $comps_wav); + my @comps = ($comps_atm, $comps_lnd, $comps_ocn, $comps_ice, $comps_glc, $comps_rof, $comps_wav); # Create sourcemods foreach my $comp (@comps) { - mkpath("$caseroot/SourceMods/src.$comp"); + mkpath("$caseroot/SourceMods/src.$comp"); # Note: this is CESM specific given that we are referencing cism explitly if ($comp eq 'cism') { @@ -1057,8 +1060,8 @@ sub _create_caseroot_sourcemods } } - mkpath("$caseroot/SourceMods/src.share"); - mkpath("$caseroot/SourceMods/src.drv"); + mkpath("$caseroot/SourceMods/src.share"); + mkpath("$caseroot/SourceMods/src.drv"); } #------------------------------------------------------------------------------- @@ -1089,7 +1092,7 @@ sub _set_test my $desc = $child_nodes[0]->textContent(); $logger->warn( " $name ($desc) ") ; } - $logger->logdie( "_set_test: exiting"); + $logger->logdie( "_set_test: exiting"); } } @@ -1097,8 +1100,8 @@ sub _set_test sub _clean { my ($name) = @_; - - $name =~ s/^\s+//; # strip any leading whitespace + + $name =~ s/^\s+//; # strip any leading whitespace $name =~ s/\s+$//; # strip any trailing whitespace return ($name); } From 10be4d15cb81e47ca8e3cab123a975e00154a528 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 2 Mar 2016 07:06:01 -0700 Subject: [PATCH 36/46] improve documentation of COMP_RUN_BARRIERS variable --- driver_cpl/cime_config/config_component.xml | 643 ++++++++++---------- utils/perl5lib/Batch/BatchUtils.pm | 248 ++++---- 2 files changed, 448 insertions(+), 443 deletions(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index a57d550d627..5cc019afd92 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -4,7 +4,7 @@ - + char cpl cpl @@ -18,36 +18,36 @@ - + char $CIMEROOT/config_files.xml case_def env_case.xml master configuration file that specifies all relevant filenames - and directories to configure a case - + and directories to configure a case + - + char UNSET case_def env_case.xml full pathname of case - + - + char $CASEROOT/logs run_desc env_run.xml Extra copies of the component log files will be saved here. - + - + char $CASEROOT/Tools case_der @@ -55,7 +55,7 @@ Case Tools directory location (derived variable, not in namelists - + char $CASEROOT/Buildconf case_der @@ -63,7 +63,7 @@ Buildconf directory location (derived variable not in namelist) - + char $CIMEROOT/scripts case_der @@ -71,23 +71,23 @@ Scripts root directory location (setup automatically to $CIMEROOT/scripts- DO NOT EDIT) - + char UNSET case_def env_case.xml full pathname of source root directory - + - + char UNSET case_def env_case.xml full pathname of CIME source root directory - + - + char $CIMEROOT/scripts/Tools case_der @@ -99,7 +99,7 @@ - + char*256 UNSET case_def @@ -107,7 +107,7 @@ case name - + char UNSET run_desc @@ -115,14 +115,14 @@ case description - + char UNSET case_last env_case.xml Component set long name (for documentation only - DO NOT EDIT) - + char UNSET @@ -131,7 +131,7 @@ Model grid - DO NOT EDIT (for experts only) - + char UNSET case_def @@ -139,27 +139,27 @@ current machine name support contact - + char UNSET case_desc env_case.xml case user name - + - + char startup,hybrid,branch startup run_begin_stop_restart env_run.xml - Determines the model run initialization type. - This setting is only important for the initial run of a production run when the + Determines the model run initialization type. + This setting is only important for the initial run of a production run when the CONTINUE_RUN variable is set to FALSE. After the initial run, the CONTINUE_RUN variable is set to TRUE, and the model restarts exactly using input files in a case, date, and bit-for-bit continuous fashion. @@ -193,7 +193,7 @@ To set up a branch run, locate the restart tar file or restart directory for RUN_REFCASE and RUN_REFDATE from a previous run, then place those files in the RUNDIR directory. - --- In a hybrid run the model is initialized as a startup, BUT uses + --- In a hybrid run the model is initialized as a startup, BUT uses initialization datasets FROM A PREVIOUS case. This is somewhat analogous to a branch run with relaxed restart constraints. A hybrid run allows users to bring together combinations @@ -211,7 +211,7 @@ - + char*256 ccsm4_init run_begin_stop_restart @@ -221,7 +221,7 @@ - + char*256 case.std run_begin_stop_restart @@ -231,7 +231,7 @@ - + char*10 0001-01-01 run_begin_stop_restart @@ -241,7 +241,7 @@ - + char 00000 run_begin_stop_restart @@ -251,7 +251,7 @@ - + logical TRUE,FALSE FALSE @@ -260,21 +260,21 @@ Allow same branch casename as reference casename. Only used for branch runs. - + - + logical TRUE,FALSE FALSE run_begin_stop_restart env_run.xml - Flag for automatically prestaging the refcase restart dataset. + Flag for automatically prestaging the refcase restart dataset. If TRUE, then the refcase data is prestaged into the executable directory - + - + char 0001-01-01 run_begin_stop_restart @@ -284,7 +284,7 @@ - + integer 0 run_begin_stop_restart @@ -294,7 +294,7 @@ - + char none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end ndays @@ -305,7 +305,7 @@ - + integer 5 run_begin_stop_restart @@ -315,7 +315,7 @@ - + integer -999 run_begin_stop_restart @@ -326,7 +326,7 @@ - + char none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end $STOP_OPTION @@ -338,17 +338,17 @@ - + char $STOP_N run_begin_stop_restart env_run.xml - + sets model restart writes with REST_OPTION and REST_DATE - + char $STOP_DATE run_begin_stop_restart @@ -359,7 +359,7 @@ - + char none,never,nsteps,nstep,nseconds,nsecond,nminutes,nminute,nhours,nhour,ndays,nday,nmonths,nmonth,nyears,nyear,date,ifdays0,end never @@ -370,17 +370,17 @@ - + char 1 run_begin_stop_restart env_run.xml - + sets periodic model barriers with BARRIER_OPTION and BARRIER_DATE for synchronization - + char -999 run_begin_stop_restart @@ -391,24 +391,24 @@ - + logical TRUE,FALSE FALSE run_begin_stop_restart env_run.xml - A setting of TRUE implies a continuation run + A setting of TRUE implies a continuation run When you first begin a branch, hybrid or startup run, CONTINUE_RUN must be set to FALSE. When you successfully run and get a restart file, you will need to change CONTINUE_RUN to TRUE for the remainder - of your run. This variable determines if the run is a restart run. + of your run. This variable determines if the run is a restart run. Set to FALSE when initializing a startup, branch or hybrid case. Set to TRUE when continuing a run. - + integer 0 run_begin_stop_restart @@ -417,7 +417,7 @@ Enables the model to automatically resubmit a new run. To get multiple runs, set RESUBMIT greater than 0, then RESUBMIT will be decremented and the case will be resubmitted. The case will stop automatically - resubmitting when the RESUBMIT value reaches 0. + resubmitting when the RESUBMIT value reaches 0. Long runs can easily outstrip supercomputer queue time limits. For this reason, a case is usually run as a series of jobs, each restarting where the previous finished. @@ -432,13 +432,13 @@ env_run.xml Logical to determine whether CESM run has been submitted with the submit script or not - + - + logical TRUE,FALSE TRUE @@ -448,7 +448,7 @@ If TRUE, short term archiving will be turned on. - + logical TRUE,FALSE FALSE @@ -460,11 +460,11 @@ The restart files are saved under the specific component directory ($DOUT_S_ROOT/$CASE/$COMPONENT/rest rather than the top-level $DOUT_S_ROOT/$CASE/rest directory). Interim restart files are created using the REST_N and REST_OPTION variables. - This is for expert users ONLY and requires expert knowledge. + This is for expert users ONLY and requires expert knowledge. We will not document this further in this guide. - + - + logical TRUE,FALSE FALSE @@ -593,24 +593,24 @@ The scratchroot root directory. Base diretory for build and run directories. - + char - + UNSET build_def env_build.xml - Case executable root directory. + Case executable root directory. (executable is $EXEROOT/cesm.exe, component libraries are in $EXEROOT/bld) - This is where the model builds its executable and by default runs the executable. + This is where the model builds its executable and by default runs the executable. Note that EXEROOT needs to have enough disk space for the experimental configuration requirements. As an example, a model run can produce more than a terabyte of data during a 100-year run, so you should set EXEROOT to scratch or tmp space and frequently back up the data to a long term archiving storage device For a supported machine, EXEROOT is set in $CIMEROOT/machines/config_machines.xml. For a userdefined machine, EXEROOT must explicitly be set it in env_build.xml. - + - + char USERDEFINED_required_macros @@ -619,17 +619,17 @@ Operating system - DO NOT EDIT UNLESS for userdefined machine - ignored once Macros has been created. - + char - - + + build_macros env_build.xml Set in $CIMEROOT/machines/config_machines.xml for each supported machine. Machine compiler (must match one the supported compilers) - ignored once Macros has been created. - + - + char @@ -638,41 +638,41 @@ Machine compiler (must match one the supported compilers) Set in $CIMEROOT/machines/config_machines.xml for each supported machine. Must be explicitly set in env_build.xml for userdefined machine. - + - + char - - + + build_macros env_build.xml Supported mpi libraries for target machine - set in config_machines.xml - (DO NOT EDIT) Set in $CIMEROOT/machines/config_machines.xml for each supported machine. Must be explicitly set in env_build.xml for userdefined machine. - + - + char build_def env_build.xml email address of person (or group) that supports the build and port for this machine (do not edit)> - + - + char - + USERDEFINED_required_macros build_macros env_build.xml - mpi library (must match one of the supported libraries) - + mpi library (must match one of the supported libraries) - ignored once Macros has been created Set in $CIMEROOT/machines/config_machines.xml for each supported machine. Must be explicitly set in env_build.xml for userdefined machine. - + - + char NO_LEAP,GREGORIAN NO_LEAP @@ -681,7 +681,7 @@ calendar type> - + char MCT,ESMF MCT @@ -690,7 +690,7 @@ use MCT or ESMF component interfaces - + char TRUE,FALSE FALSE @@ -699,31 +699,31 @@ TRUE implies using the ESMF library specified by ESMF_LIBDIR or ESMFMKFILE - + logical - TRUE,FALSE + TRUE,FALSE FALSE build_def env_build.xml TRUE implies turning on run and compile time debugging - Flag to turn on debugging for run time and compile time. - If TRUE, compile-time debugging flags are activated that you can use to verify + Flag to turn on debugging for run time and compile time. + If TRUE, compile-time debugging flags are activated that you can use to verify software robustness, such as bounds checking. - Important:: On IBM machines, floating point trapping is not activated for production + Important:: On IBM machines, floating point trapping is not activated for production runs (i.e., non-DEBUG), due to performance penalties associated with turning on these flags. - + - + logical TRUE,FALSE FALSE build_def env_build.xml TRUE implies always build model for openmp capability - If FALSE, component libraries are built with OpenMP capability only if + If FALSE, component libraries are built with OpenMP capability only if the NTHREADS_ setting for that component is greater than 1 in env_mach_pes.xml. If TRUE, the component libraries are always built with OpenMP capability. - + logical @@ -738,7 +738,7 @@ executable. This is currently only supported for certain machines. - + char gmake @@ -747,70 +747,70 @@ GNU make command - + integer - + 1 build_def env_build.xml Number of processors for gmake - + int TRUE,FALSE FALSE build_status env_build.xml Status output: if TRUE, models have been built successfully. (DO NOT EDIT)> - + - + char - + 0 build_status env_build.xml Status: smp status of previous build, coded string. (DO NOT EDIT)> - + - + char 0 build_status env_build.xml Status: smp status of current case, coded string (DO NOT EDIT)> - + - + char - + 0 build_status env_build.xml Status: ninst status of previous build, coded string. (DO NOT EDIT)> - + - + char 0 build_status env_build.xml Status: ninst status of current case, coded string (DO NOT EDIT)> - + - + integer - 0,1,2 + 0,1,2 0 build_status env_build.xml Status: of prior build. (DO NOT EDIT)> - + - + char $EXEROOT @@ -819,16 +819,16 @@ case build directory (set automatically to $EXEROOT, - DO NOT EDIT) - + char - + $EXEROOT/lib build_derived env_build.xml case lib directory (set automatically to $EXEROOT/lib - DO NOT EDIT) - + char $EXEROOT/lib/include @@ -859,7 +859,7 @@ - + logical TRUE,FALSE TRUE @@ -868,7 +868,7 @@ logical to diagnose model timing at the end of the run - + logical TRUE,FALSE FALSE @@ -877,7 +877,7 @@ logical to save timing files in rundir - + integer 12 run_flags @@ -892,17 +892,20 @@ run_cesm env_run.xml Enables the papi hardware counters in gptl - The papi library must be included in the build step for + The papi library must be included in the build step for this to work. - + logical TRUE,FALSE FALSE run_flags env_run.xml - Turns on component barriers for component timing + Turns on component barriers for component timing. + This variable is for testing and debugging only and should never + be set for a production run. + @@ -913,23 +916,23 @@ cost relative to 64 pes (DO NOT EDIT) - + integer - 0 + 0 mach_pes_last env_mach_pes.xml relative cost of test where ERS is 1 (DO NOT EDIT) - + integer - 0 + 0 mach_pes_last env_mach_pes.xml relative total cost of case (DO NOT EDIT) - + integer 0 mach_pes_last @@ -1037,7 +1040,7 @@ number of ice cells in j direction - DO NOT EDIT (for experts only) - + integer 1 build_grid @@ -1100,7 +1103,7 @@ run_component_cism env_run.xml glacier (glc) grid - DO NOT EDIT (for experts only) - + char @@ -1134,26 +1137,26 @@ grid mask - DO NOT EDIT (for experts only) - + logical - TRUE,FALSE - FALSE + TRUE,FALSE + FALSE run_domain env_run.xml Operate on only a single point of the global grid - DO NOT EDIT (for experts only) - + real(1) - -999.99 + -999.99 run_domain env_run.xml Latitude to find nearest points for points mode (only used if PTS_MODE is TRUE) - + real(1) - -999.99 + -999.99 run_domain env_run.xml Longitude to find nearest points for points mode (only used if PTS_MODE is TRUE) @@ -1404,7 +1407,7 @@ env_run.xml ocn2atm state mapping file - + char X,Y @@ -1584,7 +1587,7 @@ glc2lnd state mapping file decomp type - + char idmap run_domain @@ -1601,7 +1604,7 @@ glc2ice runoff mapping file decomp type - + char idmap run_domain @@ -1726,7 +1729,7 @@ Error tolerance for differences in ocean/ice lon/lat in domain checking - + real 1.0e-02 run_domain @@ -1738,7 +1741,7 @@ - + char UNSET case_def @@ -1762,19 +1765,19 @@ Machines directory location - + char UNSET run_desc env_run.xml - The directory where the executable will be run. - By default this is set to EXEROOT/../run. + The directory where the executable will be run. + By default this is set to EXEROOT/../run. RUNDIR allows you to keep the run directory separate from the build directory - + char UNSET run_din @@ -1785,9 +1788,9 @@ Default values for the target machine are in the $CIMEROOT/machines/config_machines.xml - + - + char UNSET run_din @@ -1799,26 +1802,26 @@ This is usually a shared disk area. Default values for the target machine are in the $CIMEROOT/machines/config_machines.xml - + - - char + + char UNSET run_dout env_run.xml - Root directory for short term archiving. This directory must be visible to compute nodes. - + Root directory for short term archiving. This directory must be visible to compute nodes. + - + char UNSET run_dout env_run.xml Root directory on long term archiving store system for long-term data archives. - + - + char UNSET run_machine @@ -1826,7 +1829,7 @@ command used to query batch system - + char UNSET run_machine @@ -1834,7 +1837,7 @@ command used to submit to batch system - + char UNSET run_mpi @@ -1846,7 +1849,7 @@ - + integer 0 mach_pes_atm @@ -1854,7 +1857,7 @@ number of atmosphere tasks - + integer 0 mach_pes_atm @@ -1862,7 +1865,7 @@ number of atmosphere threads - + integer 0 mach_pes_atm @@ -1887,7 +1890,7 @@ Layout of atmosphere instances - + integer 0 mach_pes_lnd @@ -1895,7 +1898,7 @@ number of land mpi tasks - + integer 0 mach_pes_lnd @@ -1903,7 +1906,7 @@ number of land mpi threads - + integer 0 mach_pes_lnd @@ -1928,7 +1931,7 @@ Layout of land instances - + integer 0 mach_pes_ice @@ -1936,7 +1939,7 @@ number of ice mpi tasks - + integer 0 mach_pes_ice @@ -1944,7 +1947,7 @@ number of ice mpi threads - + integer 0 mach_pes_ice @@ -1969,7 +1972,7 @@ Layout of sea ice instances - + integer 0 mach_pes_ocn @@ -1977,7 +1980,7 @@ number of ocean mpi tasks - + integer 0 mach_pes_ocn @@ -1985,7 +1988,7 @@ number of ocean mpi threads - + integer 0 mach_pes_ocn @@ -2010,7 +2013,7 @@ Layout of ocean instances - + integer 0 mach_pes_cpl @@ -2018,7 +2021,7 @@ number of coupler mpi tasks - + integer 0 mach_pes_cpl @@ -2026,7 +2029,7 @@ number of coupler mpi threads - + integer 0 mach_pes_cpl @@ -2034,7 +2037,7 @@ root cpl mpi task - + integer 0 @@ -2045,7 +2048,7 @@ number of glc mpi tasks - + integer 0 @@ -2056,7 +2059,7 @@ number of glc mpi threads - + integer 0 mach_pes_glc @@ -2081,7 +2084,7 @@ Layout of glacier instances - + integer 0 mach_pes_rof @@ -2089,7 +2092,7 @@ number of river runoff tasks - + integer 0 mach_pes_rof @@ -2097,7 +2100,7 @@ number of river runoff threads - + integer 0 mach_pes_rof @@ -2238,7 +2241,7 @@ total number of tasks and threads (setup automatically - DO NOT EDIT) - + integer 0 mach_pes_last @@ -2246,7 +2249,7 @@ maximum number of tasks/ threads allowed per node - + integer 0 mach_pes_last @@ -2258,7 +2261,7 @@ - + int 1 1,2 @@ -2267,7 +2270,7 @@ PIO library version - + char build_macros @@ -2282,7 +2285,7 @@ run_pio env_run.xml TRUE implies perform asynchronous i/o - + integer @@ -2323,7 +2326,7 @@ run_pio env_run.xml pio io type - + integer @@ -2388,7 +2391,7 @@ run_pio env_run.xml pio io type - + integer @@ -2429,7 +2432,7 @@ run_pio env_run.xml pio io type - + integer @@ -2470,7 +2473,7 @@ run_pio env_run.xml pio io type - + integer @@ -2511,7 +2514,7 @@ run_pio env_run.xml pio io type - + integer @@ -2552,7 +2555,7 @@ run_pio env_run.xml pio io type - + integer @@ -2593,7 +2596,7 @@ run_pio env_run.xml pio io type - + integer @@ -2634,7 +2637,7 @@ run_pio env_run.xml pio io type - + integer @@ -2796,21 +2799,21 @@ Whether to clean the test after it is built/run - + char /UNSET test env_test.xml standard baselines root directory for testing - + - + char /UNSET test env_test.xml standard full pathname of the cprnc executable - + @@ -2832,17 +2835,17 @@ env_run.xml Coupler sequencing option. This is used to set the driver namelist variable cpl_seq_option. - CESM1_ORIG is the cesm1.1 implementation. - CESM1_MOD includes a cesm1.3 mod that swaps ocean merging and atm/ocn flux - computation. - RASM_OPTION1 runs prep ocean before the ocean coupling reducing - most of the lags and field inconsistency but still allowing the ocean to run - concurrently with the ice and atmosphere. - RASM_OPTION2 is similar to RASM_OPTION1 - but sequences the ice model, prep ocean and ocean model in that order. The - ocean model loses some of the concurrency with the ice model. - CESM1_ORIG_TIGHT and CESM1_MOD_TIGHT are consistent with the old variables - ocean_tight_coupling = true in the driver. That namelist is gone and the + CESM1_ORIG is the cesm1.1 implementation. + CESM1_MOD includes a cesm1.3 mod that swaps ocean merging and atm/ocn flux + computation. + RASM_OPTION1 runs prep ocean before the ocean coupling reducing + most of the lags and field inconsistency but still allowing the ocean to run + concurrently with the ice and atmosphere. + RASM_OPTION2 is similar to RASM_OPTION1 + but sequences the ice model, prep ocean and ocean model in that order. The + ocean model loses some of the concurrency with the ice model. + CESM1_ORIG_TIGHT and CESM1_MOD_TIGHT are consistent with the old variables + ocean_tight_coupling = true in the driver. That namelist is gone and the cpl_seq_option flags take it's place. TIGHT coupling makes no sense with the OPTION5 and OPTION6 flags. @@ -2850,17 +2853,17 @@ logical - TRUE,FALSE - FALSE + TRUE,FALSE + FALSE run_coupling env_run.xml determine if per ice thickness category fields are passed from ice to ocean - DO NOT EDIT (set by POP build-namelist) - + char - none,CO2A,CO2B,CO2C,CO2_DMSA - none + none,CO2A,CO2B,CO2C,CO2_DMSA + none CO2A none @@ -2871,13 +2874,13 @@ run_coupling env_run.xml - Flag to turn on new fields in coupling. - If the value is not none, the coupler is compiled so that optional - BGC related fields are exchanged between component models. + Flag to turn on new fields in coupling. + If the value is not none, the coupler is compiled so that optional + BGC related fields are exchanged between component models. - + - + char hour,day,year,decade run_coupling @@ -2892,23 +2895,23 @@ atm_cpl_dt, lnd_cpl_dt, ocn_cpl_dt, ice_cpl_dt, glc_cpl_dt, rof_cpl_dt and wav_cpl_dt. - + char 48 - 48 + 48 144 288 288 - 48 - 48 - 72 - 48 + 48 + 48 + 72 + 48 4 24 24 - 24 - 1 + 24 + 1 96 96 96 @@ -2931,7 +2934,7 @@ where basedt is equal to NCPL_BASE_PERIOD in seconds. - + char $ATM_NCPL @@ -2944,7 +2947,7 @@ where basedt is equal to NCPL_BASE_PERIOD in seconds. - + char $ATM_NCPL @@ -2957,12 +2960,12 @@ where basedt is equal to NCPL_BASE_PERIOD in seconds. - + char $ATM_NCPL 1 - 4 + 4 1 1 1 @@ -2978,7 +2981,7 @@ where basedt is equal to NCPL_BASE_PERIOD in seconds. - + char 1 @@ -2989,7 +2992,7 @@ Number of glc coupling intervals per NCPL_BASE_PERIOD. - + char 8 @@ -3017,10 +3020,10 @@ - + logical true,false - false + false true true @@ -3028,10 +3031,10 @@ run_component_cpl env_run.xml - Only used for compsets with DATM and POP (currently C and G): + Only used for compsets with DATM and POP (currently C and G): If true, compute albedos to work with daily avg SW down If false (default), albedos are computed with the assumption that downward - solar radiation from the atm component has a diurnal cycle and zenith-angle + solar radiation from the atm component has a diurnal cycle and zenith-angle dependence. This is normally the case when using an active atm component If true, albedos are computed with the assumption that downward solar radiation from the atm component is a daily average quantity and @@ -3040,17 +3043,17 @@ - + char off,ocn - off + off ocn run_component_cpl env_run.xml - Only used for compsets with DATM and POP (currently C and G): + Only used for compsets with DATM and POP (currently C and G): If ocn, ocn provides EP balance factor for precipitation. Provides EP balance factor for precip for POP. A factor computed by POP is applied to precipitation so that precipitation balances @@ -3064,10 +3067,10 @@ - + char - - never + + never nyears @@ -3076,10 +3079,10 @@ Sets driver snapshot history file frequency (like REST_OPTION) - + integer - - -999 + + -999 1 @@ -3089,19 +3092,19 @@ - + integer - - -999 + + -999 run_drv_history env_run.xml yyyymmdd format, sets coupler snapshot history date (like REST_DATE) - + char - - never + + never nmonths @@ -3110,10 +3113,10 @@ Sets driver average history file frequency (like REST_OPTION) - + char - - -999 + + -999 1 @@ -3122,16 +3125,16 @@ Sets driver average history file frequency (like REST_N) - + integer - - -999 + + -999 run_drv_history env_run.xml yyyymmdd format, sets driver average history date (like REST_DATE) - + logical TRUE,FALSE FALSE @@ -3145,10 +3148,10 @@ logical that turns on diagnostic budgets for driver - + real - 379.000 + 379.000 284.7 284.7 @@ -3159,11 +3162,11 @@ 379.000 379.000 367.0 - 367.0 - 367.0 - 367.0 - 367.0 - 367.0 + 367.0 + 367.0 + 367.0 + 367.0 + 367.0 379.000 0.000001 0.000001 @@ -3174,9 +3177,9 @@ 0.000001 0.000001 0.000001 - 368.9 + 368.9 368.9 - 367.0 + 367.0 0.000001 0.000001 @@ -3194,7 +3197,7 @@ introduced to coordinate this value among multiple components. - + logical TRUE,FALSE FALSE @@ -3204,7 +3207,7 @@ Used to set the driver namelist variable "drv_threading". - + integer 0,1,2,3,4,5,6 0 @@ -3213,7 +3216,7 @@ Coupler decomposition option. - + logical TRUE,FALSE FALSE @@ -3222,48 +3225,48 @@ turns on coupler bit-for-bit reproducibility with varying pe counts - + integer 0,1,2,3 1 run_flags env_run.xml level of debug output, 0=minimum, 1=normal, 2=more, 3=too much - + - + char*256 - on, off + on, off off case_def env_case.xml If set to off, this component set/ grid specification is not scientifically supported. If set to on, this component set/ grid specification is scientifically supported - + - + integer - - 0 + + 0 - - -3 - -3 - -1 - 1 - 1 - -1 - 1 - -2 + + -3 + -3 + -1 + 1 + 1 + -1 + 1 + -2 -5 -5 -6 - 0 - 0 - 0 - 0 - 1 - 3 + 0 + 0 + 0 + 0 + 1 + 3 1 3 1 @@ -3283,13 +3286,13 @@ 2**n relative cost of compset where B is 1 (DO NOT EDIT) - + integer 0,1,3,5,10,36 0 - 10 - 10 + 10 + 10 run_glc env_run.xml @@ -3297,7 +3300,7 @@ Used by both CLM and CISM (even if CISM is not running, and only SGLC is used). - + logical TRUE,FALSE FALSE @@ -3319,19 +3322,19 @@ compsets. - + integer - - 0 + + 0 case_cost env_case.xml 2**n relative cost of grid where f19_g15 is 1 (DO NOT EDIT) - + integer - - 0 + + 0 case_cost env_case.xml 2**n relative cost of machine (DO NOT EDIT) @@ -3381,14 +3384,14 @@ env_batch.xml The machine wallclock setting. Default determined in config_machines.xml can be overwritten by testing - - + + char PROJECT_UNSET job_submission env_batch.xml project for project-sensitive build and run paths, and job scripts - + logical @@ -3398,41 +3401,41 @@ env_batch.xml whether the PROJECT value is required on this machine - + BGC CO2=prog, rad CO2=prog: BGC CO2=diag, rad CO2=diag: ECO in POP: - --DO NOT USE FOR LONG SIMULATIONS: + --DO NOT USE FOR LONG SIMULATIONS: pre-industrial: present day: - Historical 1850 to 2000 transient: + Historical 1850 to 2000 transient: AMIP for stand-alone cam: - CCMI REFC2 1950 to 2100 transient: - CCMI REFC2 2004 to 2100 transient: - 1948 to 2004 transient: - CCMI REFC1 Free running, 1950 to 2010 transient: - CCMI REFC1 Specified dynamics, 1975 to 2010 transient: + CCMI REFC2 1950 to 2100 transient: + CCMI REFC2 2004 to 2100 transient: + 1948 to 2004 transient: + CCMI REFC1 Free running, 1950 to 2010 transient: + CCMI REFC1 Specified dynamics, 1975 to 2010 transient: RCP8.5 future scenario: RCP6.0 future scenario: RCP4.5 future scenario: - 1955 to 2005 transient: + 1955 to 2005 transient: RCP8.5 future scenario: RCP6.0 future scenario: RCP4.5 future scenario: RCP2.6 future scenario: RCP4.5 based scenario from 2013 (control for WACCM/CARMA nuclear winter study): 1992 to 2005 transient: - GEOS5 meteorology: for stand-alone cam - ARM95 IOP: for stand-alone cam - ARM97 IOP: for stand-alone cam + GEOS5 meteorology: for stand-alone cam + ARM95 IOP: for stand-alone cam + ARM97 IOP: for stand-alone cam CLM transient land use: pre-industrial (1850) to present day: -----------------------------WARNING ------------------------------------------------ - "PIPD" compsets use complete forcing data from observed sources - up to the year 2005. Following this period they are a combination of observed sources - (land-use, SST, sea ice, CO2, CH4, N2O) to present day and IPCC RCP4.5 scenario data. + "PIPD" compsets use complete forcing data from observed sources + up to the year 2005. Following this period they are a combination of observed sources + (land-use, SST, sea ice, CO2, CH4, N2O) to present day and IPCC RCP4.5 scenario data. ------------------------------------------------------------------------------------- @@ -3445,7 +3448,7 @@ ========================================= - Notes: + Notes: (1) Time period is first four characters of compset name ========================================= diff --git a/utils/perl5lib/Batch/BatchUtils.pm b/utils/perl5lib/Batch/BatchUtils.pm index eb728059ff2..20cdb9bc3c3 100755 --- a/utils/perl5lib/Batch/BatchUtils.pm +++ b/utils/perl5lib/Batch/BatchUtils.pm @@ -1,9 +1,9 @@ #!/usr/bin/env perl; #============================================================================== # File: BatchUtils.pm -# Purpose: Utility class for submitting jobs, and managing dependencies. -# PLEASE NOTE: for each subclass you define, you MUST add a _test() method -# to the subclass for the factory to work +# Purpose: Utility class for submitting jobs, and managing dependencies. +# PLEASE NOTE: for each subclass you define, you MUST add a _test() method +# to the subclass for the factory to work # #============================================================================== use strict; @@ -24,10 +24,10 @@ BEGIN{ } #============================================================================== -# Base class constructor. required args are the case name, caseroot, cime root, +# Base class constructor. required args are the case name, caseroot, cime root, # compiler, machine, machine root directory, the mpi library, -# get the paths to the config_machines and config_batch xml files, and figure out -# the batch system type. +# get the paths to the config_machines and config_batch xml files, and figure out +# the batch system type. #============================================================================== sub new { @@ -55,7 +55,7 @@ sub new my $xml = XML::LibXML->new(no_blanks => 1); my $machineconfig = $xml->parse_file($configmachines); my $root = $machineconfig->getDocumentElement(); - + my @batchtypes = $root->findnodes("/config_machines/machine[\@MACH=\'$self->{machine}\']/batch_system"); if(! @batchtypes) { @@ -73,7 +73,7 @@ sub _check() return 1; } #============================================================================== -# Get the batch system type for this machine. +# Get the batch system type for this machine. #============================================================================== sub getBatchSystemType() { @@ -112,7 +112,7 @@ sub getDependString() } #============================================================================== -# Get the job id from the output of the job submission. +# Get the job id from the output of the job submission. #============================================================================== sub getJobID() { @@ -140,7 +140,7 @@ sub getJobID() $jobidpat = $basejobidpatterns[0]->textContent(); } } - + my $jobid = undef; my $pattern = qr($jobidpat); if($jobstring =~ /$pattern/ ) @@ -163,7 +163,7 @@ sub submitJobs() my $self = shift; my $scriptname = shift; my $depjobid = undef; - + my %depqueue = %{$self->{dependencyqueue}}; my $lastjobseqnum = (sort {$b <=> $a } keys %depqueue)[0]; foreach my $jobnum(sort keys %depqueue) @@ -181,9 +181,9 @@ sub submitJobs() } #============================================================================== -# Submit a job, given the script name. If a dependent job id is given, -# use it as the dependency. If the islastjob flag is passed in, add the -# islastjob=TRUE flag to the environment of the job submission.. +# Submit a job, given the script name. If a dependent job id is given, +# use it as the dependency. If the islastjob flag is passed in, add the +# islastjob=TRUE flag to the environment of the job submission.. #============================================================================== sub submitSingleJob() { @@ -207,7 +207,7 @@ sub submitSingleJob() chdir $config{'CASEROOT'}; my $runcmd = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} ./$scriptname "; - $logger->info(": $runcmd"); + $logger->info(": $runcmd"); my $output; eval { @@ -220,9 +220,9 @@ sub submitSingleJob() { $logger->logdie("job submission failed $?"); } - - chomp $output; - + + chomp $output; + my $jobid = $self->getJobID($output); $logger->debug( "Job ID: $jobid"); return $jobid; @@ -239,9 +239,11 @@ sub _decrementResubmitCounter() } my $owd = getcwd; chdir $config->{'CASEROOT'}; - if($config->{COMP_RUN_BARRIERS} ne "TRUE") + if($config->{COMP_RUN_BARRIERS} ne "TRUE") { `./xmlchange -noecho CONTINUE_RUN=TRUE`; + }else{ + $logger->warn("NOT changing CONTINUE_RUN since COMP_RUN_BARRIERS is on") } `./xmlchange -noecho RESUBMIT=$newresubmit`; if($?) @@ -252,7 +254,7 @@ sub _decrementResubmitCounter() } #============================================================================== # Base class doResubmit -# Check to see if the next set of jobs needs to be submitted. +# Check to see if the next set of jobs needs to be submitted. #====================================================== sub doResubmit() @@ -268,16 +270,16 @@ sub doResubmit() } #============================================================================== -# If we need to resubmit a job + post-run jobs, this subroutine will check the -# env*.xml variables to see which jobs need to be resubmitted. -# For now, we are only handling runs and the short-term archiver. +# If we need to resubmit a job + post-run jobs, this subroutine will check the +# env*.xml variables to see which jobs need to be resubmitted. +# For now, we are only handling runs and the short-term archiver. #============================================================================== sub dependencyCheck() { my $self = shift; my $scriptname = shift;; my %config = %{$self->{'caseconfig'}}; - + $self->{dependencyqueue} = undef; # we always want to run the test or run again.. if(-e "case.test") @@ -290,8 +292,8 @@ sub dependencyCheck() my $jobname = "case.run"; $self->addDependentJob($jobname); } - - # do we add the short-term archiver to the dependency queue? + + # do we add the short-term archiver to the dependency queue? if($config{'DOUT_S'} eq 'TRUE') { my $jobname = "case.st_archive"; @@ -302,11 +304,11 @@ sub dependencyCheck() my $jobname = "case.lt_archive"; $self->addDependentJob($jobname); } - + } #============================================================================== -# Adds a job script name or array of job script names to the dependent jobs queue. +# Adds a job script name or array of job script names to the dependent jobs queue. #============================================================================== sub addDependentJob() { @@ -314,29 +316,29 @@ sub addDependentJob() # Either a string with the job name or an array of job names my $jobref = shift; my $jobcounter = 0; - - # set up the dependency hash if not done. + + # set up the dependency hash if not done. if(! defined $self->{dependencyqueue}) { $self->{dependencyqueue} = {}; } - # get the dependency hash. + # get the dependency hash. my %dependencyqueue = %{$self->{dependencyqueue}}; - - # Increment the job counter for each job set in the dependency queue. + + # Increment the job counter for each job set in the dependency queue. foreach my $jobnum(keys %{$self->{dependencyqueue}}) { $jobcounter += 1; } - # If the jobref is a regular string scalar, make an array out of it - # and add it to the dependency queue. + # If the jobref is a regular string scalar, make an array out of it + # and add it to the dependency queue. if(! ref($jobref) ) { my @jobarray = ( $jobref ); $dependencyqueue{$jobcounter} = \@jobarray; } - # if we have an array, add the array to the dependency queue directly. + # if we have an array, add the array to the dependency queue directly. elsif(ref($jobref) eq 'ARRAY') { $dependencyqueue{$jobcounter} = $jobref; @@ -345,8 +347,8 @@ sub addDependentJob() } #============================================================================== -# Base class getSubmitArguments. If we need to have submit arguments to qsub, -# then this method will pull them out and set them up. +# Base class getSubmitArguments. If we need to have submit arguments to qsub, +# then this method will pull them out and set them up. #============================================================================== sub getSubmitArguments() { @@ -357,12 +359,12 @@ sub getSubmitArguments() $scriptname =~ /\w+\.(\w+)$/; $self->{job} = $1; $logger->debug(" scriptname: $scriptname job $self->{job}"); - # Get BatchMaker instance, we need its instance data. - my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, + # Get BatchMaker instance, we need its instance data. + my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, cimeroot => $self->{cimeroot}, case => $self->{case}, - mpilib => $self->{mpilib}, - machroot => $self->{machroot}, + mpilib => $self->{mpilib}, + machroot => $self->{machroot}, machine => $self->{machine}, compiler => $self->{compiler}, job => $self->{job} ); @@ -396,7 +398,7 @@ sub getSubmitArguments() else { # if argFlag ends in an = sign dont put any space before field - if($argFlag =~ /=$/){ + if($argFlag =~ /=$/){ $submitargs .= " $argFlag$field"; }else{ $submitargs .= " $argFlag $field"; @@ -404,7 +406,7 @@ sub getSubmitArguments() } } # If the argName isn't defined, just use the argflag, there;s - # no data to replace. + # no data to replace. elsif(defined $argFlag && ! defined $argName) { $submitargs .= " $argFlag"; @@ -413,7 +415,7 @@ sub getSubmitArguments() } # If we have a dependent job id, we need to get the depend string - # for this particular setup, and add it to the submit arguments. + # for this particular setup, and add it to the submit arguments. if(defined $dependentjobid) { my $dependArg = $self->getDependString($dependentjobid); @@ -425,10 +427,10 @@ sub getSubmitArguments() #============================================================================== -# Factory package for getting the correct BatchUtils class. Either machine-specific or +# Factory package for getting the correct BatchUtils class. Either machine-specific or # batch system specific classes can be defined in this package, and that specific -# class will be returned if it exists, or the base class will be returned if -# nothing machine-specific or batch system specific exists. +# class will be returned if it exists, or the base class will be returned if +# nothing machine-specific or batch system specific exists. #============================================================================== package Batch::BatchUtilsFactory; use Exporter qw(import); @@ -437,38 +439,38 @@ use XML::LibXML; sub getBatchUtils { my (%params) = @_; - + # We need a machine to be defined my $machine = $params{'machine'}; if(!defined $machine) { $logger->logdie ("BatchUtilsFactory: machine must be defined!"); } - - # Find the batch system type based on the machine. + + # Find the batch system type based on the machine. my $batchtype = getBatchSystemType($params{'machine'}, $params{'machroot'}, $params{'caseroot'}); - # Make a new base class + # Make a new base class my $batchutils = Batch::BatchUtils->new(%params); - + # Get the machine-specific and batch-specific class names - my $machclassname = "Batch::BatchUtils_" . $machine; + my $machclassname = "Batch::BatchUtils_" . $machine; my $batchclassname = "Batch::BatchUtils_" . $batchtype; - # Try to re-bless the base class into the machine-specific class. - # then test to see if we can actually call methods. If the - # eval fails, then we know the machine-specific class doesn't exist. - my $rv = eval - { + # Try to re-bless the base class into the machine-specific class. + # then test to see if we can actually call methods. If the + # eval fails, then we know the machine-specific class doesn't exist. + my $rv = eval + { #$machclassname->new(%params); #require $machclassname; bless $batchutils, $machclassname; $batchutils->_test(); 1; }; - # If we don't get an error, return the machine-specific - # BatchUtils object. + # If we don't get an error, return the machine-specific + # BatchUtils object. if(! $@) { return $batchutils; @@ -478,12 +480,12 @@ sub getBatchUtils bless $batchutils, "Batch::BatchUtils"; } - # Now try to create the batch-system specific class. - $rv = eval - { + # Now try to create the batch-system specific class. + $rv = eval + { #$batchclassname->new(%params); #require $batchclassname; - bless $batchutils, $batchclassname; + bless $batchutils, $batchclassname; $batchutils->_test(); #1; }; @@ -495,7 +497,7 @@ sub getBatchUtils } # just to make sure, if we're here, we should be returning the # base class BatchUtils - else + else { bless $batchutils, "Batch::BatchUtils"; return $batchutils; @@ -504,7 +506,7 @@ sub getBatchUtils } #============================================================================== -# BatchUtilsFactory getBatchSystemType method. +# BatchUtilsFactory getBatchSystemType method. #============================================================================== sub getBatchSystemType() { @@ -530,12 +532,12 @@ sub getBatchSystemType() #============================================================================== -# Mira/ALCF specific BatchUtils class, since the workflow for ALCF has to be -# completely different. -# Current workflow: -# Run on Mira or Cetus. When done, ssh over to cooleylogin1 and submit -# the short-term archive run. If we need to continue and resubmit, we will then -# ssh back to either Mira or Cetus and resubmit the run. +# Mira/ALCF specific BatchUtils class, since the workflow for ALCF has to be +# completely different. +# Current workflow: +# Run on Mira or Cetus. When done, ssh over to cooleylogin1 and submit +# the short-term archive run. If we need to continue and resubmit, we will then +# ssh back to either Mira or Cetus and resubmit the run. #============================================================================== package Batch::BatchUtils_mira; use base qw( Batch::BatchUtils ); @@ -543,9 +545,9 @@ use base qw( Batch::BatchUtils ); use Cwd; #============================================================================== -# Overridden submitJobs() method for Mira. -# For ALCF, we really only want this method to submit the run. -# The short-term archiver and resubmission will be handled elsewhere. +# Overridden submitJobs() method for Mira. +# For ALCF, we really only want this method to submit the run. +# The short-term archiver and resubmission will be handled elsewhere. #============================================================================== sub submitJobs() { @@ -553,23 +555,23 @@ sub submitJobs() my %depqueue = %{$self->{dependencyqueue}}; - # Get the first job sequence number. + # Get the first job sequence number. my $firstjobseqnum = (sort {$a <=> $b } keys %depqueue)[0]; - # we get the first job array reference. + # we get the first job array reference. my $firstjobarray = $depqueue{$firstjobseqnum}; - # Get the first job name. + # Get the first job name. my $firstjobname = $$firstjobarray[0]; - # submit the run, and nothing else. + # submit the run, and nothing else. $self->submitSingleJob($firstjobname); } #============================================================================== -# ALCF-specific single job submission. -# The trick with ALCF is when we need to know which machine to ssh back to +# ALCF-specific single job submission. +# The trick with ALCF is when we need to know which machine to ssh back to +# to resubmit the run. +# So, write a 'workflowhostfile' which contains the hostname we need to ssh back to # to resubmit the run. -# So, write a 'workflowhostfile' which contains the hostname we need to ssh back to -# to resubmit the run. # mira submitSingleJob #============================================================================== sub submitSingleJob() @@ -580,13 +582,13 @@ sub submitSingleJob() if(! -e $workflowhostfile) { open (my $W, ">", $workflowhostfile) or $logger->logdie ("could not open workflow host file, $!"); - my $host = (defined $ENV{HOST})? $ENV{HOST}: $ENV{HOSTNAME}; + my $host = (defined $ENV{HOST})? $ENV{HOST}: $ENV{HOSTNAME}; print $W "$host\n"; close $W; $logger->info("Setting workflow host $host"); } my %config = %{$self->{'caseconfig'}}; - + my $dependarg = ''; my $submitargs = ''; $submitargs = $self->getSubmitArguments($scriptname); @@ -600,9 +602,9 @@ sub submitSingleJob() $logger->info( "Submitting job $runcmd"); $logger->debug("Runcmd: $runcmd"); - + my $output; - + eval { open(my $RUN, "-|", $runcmd) // $logger->logdie (" job submission failed, $!"); $output = <$RUN>; @@ -619,25 +621,25 @@ sub submitSingleJob() return undef; } #============================================================================== -# Mira-specific doResubmit call. If this is called from the run, then we -# have to ssh over to cooley and run the short-term archiver. -# If called from the short-term archiver, +# Mira-specific doResubmit call. If this is called from the run, then we +# have to ssh over to cooley and run the short-term archiver. +# If called from the short-term archiver, #============================================================================== sub doResubmit() { my ($self, $scriptname) = @_; my %config = %{$self->{'caseconfig'}}; - + #If we're NOT doing short-term archiving, and we need to resubmit, then we need to resubmit JUST the run my $issta = ($scriptname =~ /archive/); - + if(! $issta && $config{'RESUBMIT'} > 0 && $config{'DOUT_S'} eq 'FALSE') { chdir $config{'CASEROOT'}; my $submitargs = $self->getSubmitArguments($scriptname); - + my $runcmd = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} $scriptname "; $logger->info("1: $runcmd"); qx($runcmd); @@ -652,8 +654,8 @@ sub doResubmit() } - # If we ARE doing short-term archiving and we aren't resubmitting, then - # just run the short-term archiver + # If we ARE doing short-term archiving and we aren't resubmitting, then + # just run the short-term archiver if(! $issta && $config{'DOUT_S'} eq 'TRUE' && $config{'RESUBMIT'} == 0) { chdir $config{'CASEROOT'}; @@ -661,13 +663,13 @@ sub doResubmit() # replace .run or .test with .st_archive my($basename, $path) = fileparse($scriptname); - my $starchivescript = "$path/$basename.st_archive"; + my $starchivescript = "$path/$basename.st_archive"; my $submitargs = $self->getSubmitArguments($starchivescript); - + my $submitstuff = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} $starchivescript"; - + my $runcmd = "ssh cooleylogin1 $submitstuff"; - + $logger->info("2: $runcmd"); qx($runcmd); if($? != 0) @@ -675,10 +677,10 @@ sub doResubmit() $logger->logdie( "could not execute runcmd $runcmd, $! $?"); exit(1); } - + } - + # If we're post run and we need to run the short-term archiver AND resubmit, then run the short-term archiver # on cooley if(! $issta && $config{'RESUBMIT'} > 0 && $config{'DOUT_S'} eq 'TRUE') @@ -691,7 +693,7 @@ sub doResubmit() $starchivescript =~ s/test/st_archive/g; } my $submitargs = $self->getSubmitArguments($starchivescript); - + my $submitstuff = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} $starchivescript"; my $runcmd = "ssh cooleylogin1 $submitstuff"; $logger->info("3: $runcmd"); @@ -705,12 +707,12 @@ sub doResubmit() } # If we're being called by the short-term archiver, and we actually need to resubmit - # something, then ssh from the cooley compute nodes to cooleylogin1, then ssh back to - # either mira or cetuslac1, and resubmit the run. + # something, then ssh from the cooley compute nodes to cooleylogin1, then ssh back to + # either mira or cetuslac1, and resubmit the run. if($issta && $config{RESUBMIT} > 0) { chdir $config{'CASEROOT'}; - + my $runscript = $scriptname; if(defined $config{TESTCASE}){ $runscript =~ s/st_archive/test/g; @@ -718,9 +720,9 @@ sub doResubmit() $runscript =~ s/st_archive/run/g; } - + my $submitargs = $self->getSubmitArguments($runscript); - + my $submitstuff = "$config{'BATCHSUBMIT'} $submitargs $config{'BATCHREDIRECT'} $runscript"; open (my $W, "<", "./workflowhostfile" ) or $logger->logdie( "could not open workflow host file, $!"); my $text = <$W>; @@ -744,40 +746,40 @@ sub doResubmit() exit(1); } $self->_decrementResubmitCounter(\%config); - + } - + } #============================================================================== # If we need arguments when we submit a job, this is where we will add them. -# This is really specific to Mira/ALFC, no center requires qsub submit arguments. +# This is really specific to Mira/ALFC, no center requires qsub submit arguments. #============================================================================== sub getSubmitArguments() { my $self = shift; - - # We need the script name and the dependent job id. + + # We need the script name and the dependent job id. my $scriptname = shift; my $dependentjobid = shift; $scriptname =~ /\.([^\.]+)$/; my $job = $1; - my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, + my $batchmaker = Batch::BatchFactory::getBatchMaker( caseroot => $self->{caseroot}, cimeroot => $self->{cimeroot}, case => $self->{case}, - mpilib => $self->{mpilib}, - machroot => $self->{machroot}, + mpilib => $self->{mpilib}, + machroot => $self->{machroot}, machine => $self->{machine}, compiler => $self->{compiler}, job => $job ); - - # Set the node count to 1 if this is the short-term archive script. + + # Set the node count to 1 if this is the short-term archive script. if(defined $scriptname && $scriptname =~ /archive/) { $batchmaker->overrideNodeCount(1); } - # Find the submit arguments for this particular batch system. + # Find the submit arguments for this particular batch system. my $xml = XML::LibXML->new(no_blanks => 1); my $batchconfig = $xml->parse_file($self->{'configbatch'}); my $root = $batchconfig->getDocumentElement(); @@ -786,7 +788,7 @@ sub getSubmitArguments() my $submitargs = ''; - # get the flag, and the name of the flag. + # get the flag, and the name of the flag. foreach my $dependarg(@dependargs) { @@ -795,7 +797,7 @@ sub getSubmitArguments() $logger->debug( "flag: $argFlag"); if(defined $argName && length($argName) > 0) { - # Get the actual data field from the BatchMaker class. + # Get the actual data field from the BatchMaker class. my $field = $batchmaker->getField($argName); if(! defined $field) { @@ -806,7 +808,7 @@ sub getSubmitArguments() $submitargs .= " $argFlag $field"; } } - # If the argName isn't defined, + # If the argName isn't defined, elsif(defined $argFlag && ! defined $argName) { $submitargs .= " $argFlag"; @@ -824,7 +826,7 @@ sub getSubmitArguments() } #============================================================================== -# Red herring method so the factory will work. +# Red herring method so the factory will work. #============================================================================== sub _test() { From 762c0b0834c1ccb371567a154b5cf0346082afa1 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Wed, 2 Mar 2016 07:08:30 -0700 Subject: [PATCH 37/46] improve documentation of COMP_RUN_BARRIERS variable --- driver_cpl/cime_config/config_component.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index 5cc019afd92..81bd0eecc64 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -904,7 +904,9 @@ env_run.xml Turns on component barriers for component timing. This variable is for testing and debugging only and should never - be set for a production run. + be set for a production run. It has a side effect of causing + resubmit not to toggle the CONTINUE_RUN flag so that the RESUBMIT + flag can be used to run several identical runs for timing purposes. From e02e632cbd7c510c592fa5e3ef8da580d909f969 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Thu, 3 Mar 2016 15:43:59 -0700 Subject: [PATCH 38/46] Change name of Solar for GSWP3 data --- .../datm/bld/namelist_files/namelist_defaults_datm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml index 810a5285634..233ecbaa5ba 100644 --- a/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml +++ b/components/data_comps/datm/bld/namelist_files/namelist_defaults_datm.xml @@ -652,7 +652,7 @@ Currently the following streams are supported (term definitions precede the stre $DATM_CLMNCEP_YR_ALIGN $DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016 domain.GSWP3.c2014.0.5d.nc -$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016/Solar6Hrly +$DIN_LOC_ROOT_CLMFORC/atm_forcing.datm7.GSWP3.0.5d.V1.c141016/Solar clmforc.GSWP3.c2011.0.5x0.5.Solr.%ym.nc 0 coszen From 1e26343880370a8bb95cec851af72311e794fc53 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 4 Mar 2016 13:10:04 -0700 Subject: [PATCH 39/46] fix clean build issue in Makefile bug in xmlchange --- cime_config/cesm/machines/Makefile | 48 +++++++-------- scripts/Tools/clean_build | 9 +-- scripts/Tools/xmlchange | 94 +++++++++++++++--------------- 3 files changed, 73 insertions(+), 78 deletions(-) diff --git a/cime_config/cesm/machines/Makefile b/cime_config/cesm/machines/Makefile index 32fa05c5121..047cafa64e3 100644 --- a/cime_config/cesm/machines/Makefile +++ b/cime_config/cesm/machines/Makefile @@ -130,6 +130,11 @@ endif ifeq (,$(MPILIB)) MPILIB = $(shell ./xmlquery MPILIB -value) endif +ifeq ($(strip $(PIO_VERSION)),1) + CPPDEFS += -DPIO1 +endif + + ifeq (,$(SHAREDPATH)) SHAREDPATH = $(SHAREDLIBROOT)/$(COMPILER)/$(MPILIB)/$(DEBUGDIR)/$(THREADDIR) @@ -631,36 +636,25 @@ test_esmf: test_esmf.o $(LD) -o $@ test_esmf.o $(LDFLAGS) #------------------------------------------------------------------------------- -# create list of component libraries - hard-wired for current ccsm components -#------------------------------------------------------------------------------- +# create list of component libraries +#------------------------------------------------------------------------------ +CLMVER = $(filter $(CLM_CONFIG_OPTS), clm5_0 clm4_5) +ifeq ($(CLMVER),'') + LNDOBJDIR = $(EXEROOT)/lnd/obj + LNDLIBDIR=$(LIBROOT) + LNDLIB := liblnd.a +else + LNDOBJDIR = $(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/clm/obj + LNDLIBDIR = $(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/lib + LNDLIB := libclm.a +endif +INCLDIR += -I$(LNDOBJDIR) ifeq ($(ULIBDEP),$(null)) ifneq ($(LIBROOT),$(null)) ULIBDEP += $(LIBROOT)/libatm.a ULIBDEP += $(LIBROOT)/libice.a - ifeq ($(findstring clm5_0,$(CLM_CONFIG_OPTS)),clm5_0) - LNDLIB := libclm.a - else - ifeq ($(findstring clm4_5,$(CLM_CONFIG_OPTS)),clm4_5) - LNDLIB := libclm.a - else - LNDLIB := liblnd.a - endif - endif - ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) - ULIBDEP += $(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/lib/$(LNDLIB) - else - ULIBDEP += $(LIBROOT)/$(LNDLIB) - endif - ifeq ($(MODEL),driver) - ifeq ($(findstring libclm.a,$(LNDLIB)),libclm.a) - INCLDIR += -I$(SHAREDPATH)/$(COMP_INTERFACE)/$(ESMFDIR)/clm/obj - else - INCLDIR += -I$(EXEROOT)/lnd/obj - endif - endif - - + ULIBDEP += $(LNDLIBDIR)/$(LNDLIB) ULIBDEP += $(LIBROOT)/libocn.a ifeq ($(COMP_OCN), pop) ULIBDEP += $(LIBROOT)/libcvmix.a @@ -776,8 +770,8 @@ cleanrof: cd $(EXEROOT)/rof/obj ; $(RM) -f *.o *.mod cleanlnd: - $(RM) -f $(LIBROOT)/liblnd.a - cd $(EXEROOT)/lnd/obj ; $(RM) -f *.o *.mod + $(RM) -f $(LNDLIBDIR)/$(LNDLIB) + cd $(LNDOBJDIR) ; $(RM) -f *.o *.mod cleancsmshare: $(RM) -f $(CSMSHARELIB) diff --git a/scripts/Tools/clean_build b/scripts/Tools/clean_build index 1fce85a8e86..f82dd2db101 100755 --- a/scripts/Tools/clean_build +++ b/scripts/Tools/clean_build @@ -14,19 +14,20 @@ $ENV{USE_ESMF_LIB} = `./xmlquery USE_ESMF_LIB -value `; $ENV{COMP_INTERFACE} = `./xmlquery COMP_INTERFACE -value `; $ENV{BUILD_THREADED} = `./xmlquery BUILD_THREADED -value`; $ENV{PIO_VERSION} = `./xmlquery PIO_VERSION -value`; +$ENV{CLM_CONFIG_OPTS} = `./xmlquery CLM_CONFIG_OPTS -value`; sub usage { die < \$opts{csmshare}, "t" => \$opts{gptl}, "p" => \$opts{pio}, -) or usage(); +) or usage(); usage() if($opts{help}); diff --git a/scripts/Tools/xmlchange b/scripts/Tools/xmlchange index ae04d82f72d..d5f384f676b 100755 --- a/scripts/Tools/xmlchange +++ b/scripts/Tools/xmlchange @@ -40,7 +40,7 @@ REQUIRED OPTIONS Either provide ALL of the following options to modify a single variable... - -file xml file to modify + -file xml file to modify NOTE: this is no longer utilized - but is there for backwards compatibility -id xml variable id -val xml new value for variable id @@ -57,7 +57,7 @@ REQUIRED OPTIONS OPTIONAL -subgroup If the value is in more than one node change this one (default - change all) Currently this supports changing values in env_batch.xml which are defined by - the name of the job being submitted. (run, test, st_archive, lt_archive) + the name of the job being submitted. (run, test, st_archive, lt_archive) -append [or -a] append value to the end of existing value -help [or -h] Print usage to STDOUT. -noecho Do NOT echo command to CaseStatus file @@ -77,10 +77,10 @@ if ($#ARGV == -1) { # Setting autoflush (an IO::Handle method) on STDOUT helps in debugging. It forces the test # descriptions to be printed to STDOUT before the error messages start. -*STDOUT->autoflush(); +*STDOUT->autoflush(); -my $xml = XML::LibXML->new( no_blanks => 1)->parse_file("env_case.xml"); -my @nodes = $xml->findnodes(".//entry[\@id=\"CIMEROOT\"]"); +my $xml = XML::LibXML->new( no_blanks => 1)->parse_file("env_case.xml"); +my @nodes = $xml->findnodes(".//entry[\@id=\"CIMEROOT\"]"); my $cimeroot = $nodes[0]->getAttribute('value'); unshift @INC, "$cimeroot/utils/perl5lib"; @@ -133,7 +133,7 @@ if (@ARGV) { # Check for manditory case input if not just listing valid values my %idlist; if ( ! defined($settinglist) ) { - foreach my $item ( "file", "id", "val" ) + foreach my $item ( "file", "id", "val" ) { if ( ! defined($opts{$item}) ) { $logger->error( "ERROR xmlchange : Must provide $item as input argument "); @@ -143,7 +143,7 @@ if ( ! defined($settinglist) ) { $idlist{$opts{'id'}} = $opts{'val'}; } else { foreach my $varval ( split( /,/, $settinglist ) ) { - if ( $varval =~ /^([a-zA-Z0-9_]+)=([^,=]+)$/ ) { + if ( $varval =~ /^(\w+)=(.*+)$/ ){ if ( defined($idlist{$1}) ) { $logger->warn( "ERROR: variable $1 was already set once in the settings list: $settinglist"); } @@ -160,7 +160,7 @@ my @filenames = qw(env_run.xml env_build.xml env_case.xml env_mach_pes.xml env_b if ( ! defined($settinglist) ) { push (@filenames, $opts{'file'}); my $status = 0; - foreach my $filename (@filenames) + foreach my $filename (@filenames) { if ($opts{'file'} eq $filename) { $status = 1; @@ -182,22 +182,22 @@ if ( ! defined($settinglist) ) { #----------------------------------------------------------------------------------------------- my %id_file; -foreach my $id ( keys(%idlist) ) +foreach my $id ( keys(%idlist) ) { - foreach my $file (@filenames) + foreach my $file (@filenames) { next unless(-e $file); # Loop over all nodes in the file - my $xml_file = XML::LibXML->new( no_blanks => 1)->parse_file($file); - foreach my $node ($xml_file->findnodes(".//entry[\@id=\"$id\"]")) + my $xml_file = XML::LibXML->new( no_blanks => 1)->parse_file($file); + foreach my $node ($xml_file->findnodes(".//entry[\@id=\"$id\"]")) { # Store this in %id_file hash - this will be used below $id_file{$id} = $file; - + # Do error checking for requested change my $value = $node->getAttribute('value'); my($type, $valid_values, $is_list_value); - foreach my $childnode ($node->findnodes(".//*")) + foreach my $childnode ($node->findnodes(".//*")) { if ($childnode->nodeName() eq 'type') { $type = $childnode->textContent(); @@ -211,16 +211,16 @@ foreach my $id ( keys(%idlist) ) } # Determine if requested change is a value - + # If we are setting a value to another unresolved value - # such as ./xmlchange REST_OPTION=\$STOP_OPTION, - # we want to resolve STOP_OPTION, make sure whatever - # it is set to is a valid_value, then set + # such as ./xmlchange REST_OPTION=\$STOP_OPTION, + # we want to resolve STOP_OPTION, make sure whatever + # it is set to is a valid_value, then set # $value to $unresolved_value if is_valid_values passes my $unresolved_value = $idlist{$id}; if($unresolved_value =~ m/^\$/) { $logger->debug("UNRESOLVED VALUE: $unresolved_value"); - my $resolved_value = SetupTools::getSingleResolved($unresolved_value); + my $resolved_value = SetupTools::getSingleResolved($unresolved_value); $logger->debug("is_valid_value: $id, $resolved_value, $valid_values, $is_list_value"); SetupTools::is_valid_value($id, $resolved_value, $valid_values, $is_list_value); $value = $unresolved_value; @@ -241,10 +241,10 @@ foreach my $id ( keys(%idlist) ) # If warn mode is on, abort if data is set to something other than missing values if ($opts{'warn'}) { if ( $type ne 'char') { - if ( ($value !~ m/^\s*$/) && ($value !~ m/UNSET/i) ) { + if ( ($value !~ m/^\s*$/) && ($value !~ m/UNSET/i) ) { $logger->logdie ("ERROR xmlchange: Variable $id is already set to $value."); } - } elsif ( $value != -99 && $value != -999 && $value != -999.99 ) { + } elsif ( $value != -99 && $value != -999 && $value != -999.99 ) { $logger->logdie ("ERROR xmlchange : Variable $id is already set to $value."); } } @@ -258,18 +258,18 @@ foreach my $id ( keys(%idlist) ) #----------------------------------------------------------------------------------------------- # Now overwrite all the necessary files that contain variables that must be modified -# Before overwriting the file, make a backup copy in case there are file system problems, +# Before overwriting the file, make a backup copy in case there are file system problems, # this way the original xml file does not get corrupted. #----------------------------------------------------------------------------------------------- -foreach my $file (values (%id_file)) +foreach my $file (values (%id_file)) { # Create backup file my $backupfile = "$file.bak"; copy($file, $backupfile) or $logger->logdie ("A problem occurred copying $file to $backupfile, reason was $!"); - + # Write out the file header - my $xml = XML::LibXML->new( no_blanks => 1)->parse_file($file); + my $xml = XML::LibXML->new( no_blanks => 1)->parse_file($file); my $fh = IO::File->new($file, '>' ) or $logger->logdie ("can't open file: $file"); print $fh " \n"; @@ -282,25 +282,25 @@ foreach my $file (values (%id_file)) my $header_text = $nodes_header[0]->textContent(); print $fh "
"; print $fh "$header_text"; - print $fh "
"; + print $fh " "; } # Write out the groups contained in the file print $fh "\n\n"; - print $fh "\n"; - foreach my $node ($xml->findnodes(".//groups/*")) + print $fh "\n"; + foreach my $node ($xml->findnodes(".//groups/*")) { my $group = $node->textContent(); - print $fh " $group \n"; + print $fh " $group \n"; } - print $fh "\n"; + print $fh "\n"; print $fh "\n"; my @subgroups = qw(none); if($file =~ "env_batch.xml"){ @subgroups = qw(run test st_archive lt_archive); } - + my $indent = " "; my $editthis=1; my $nodename; @@ -313,7 +313,7 @@ foreach my $file (values (%id_file)) $nodename = "entry"; } # Loop over each file variable, modify if needed, then write it out - foreach my $node ($xml->findnodes(".//$nodename")) + foreach my $node ($xml->findnodes(".//$nodename")) { if($subgroup ne "none" && defined $opts{subgroup}){ $editthis = 0; @@ -329,7 +329,7 @@ foreach my $file (values (%id_file)) $value =~ s/\childNodes()) + foreach my $childnode ($node->childNodes()) { # Determine all node properties other than value if ($childnode->nodeName() eq 'desc') { @@ -356,7 +356,7 @@ foreach my $file (values (%id_file)) } # Loop over all entries in the file - foreach my $id ( keys(%idlist) ) + foreach my $id ( keys(%idlist) ) { # Make a change to the value if requested if ($id eq $name) { @@ -364,10 +364,10 @@ foreach my $file (values (%id_file)) my $newval = $id_value; if ($opts{'append'}) { # Append new value on the end of old only if old NOT unset - if ( ($value !~ m/^\s*$/) && ($value !~ m/UNSET/i) ) { + if ( ($value !~ m/^\s*$/) && ($value !~ m/UNSET/i) ) { $newval = "$value $id_value"; } - } + } $newval =~ s/'/'/g; $newval =~ s/\debug("name = $name value = $value subgroup = $subgroup"); # Write out the entry write_xml_entry($fh, $name, $value, $type, $valid_values, $desc, $group, $is_list_value, $indent); - - + + } - + if($subgroup ne "none"){ print $fh " \n"; } @@ -391,7 +391,7 @@ foreach my $file (values (%id_file)) print $fh "\n"; print $fh " \n"; - # Before finishing, remove the backup files. + # Before finishing, remove the backup files. unlink($backupfile) or $logger->warn ("unable to link $backupfile, $!"); } @@ -399,7 +399,7 @@ if (! $opts{'noecho'}) { echo_command_to_CaseStatus(); } -$logger->debug( "xmlchange done."); +$logger->debug( "xmlchange done."); exit; #----------------------------------------------------------------------------------------------- @@ -416,7 +416,7 @@ sub echo_command_to_CaseStatus { else { $logger->warn ("WARNING: No CaseStatus file found; this xmlchange command has been executed, but not recorded in the CaseStatus file"); } -} +} #----------------------------------------------------------------------------------------------- # TODO this code is duplicated in ConfigCase.pm @@ -430,19 +430,19 @@ sub write_xml_entry $value =~ s/'/'/g; $value =~ s/\\n"; - print $fh "$indent $type \n"; + print $fh "$indent\n"; + print $fh "$indent $type \n"; if ($valid_values ne '') {print $fh "$indent $valid_values \n";} if ($is_list_value ne '') {print $fh "$indent $is_list_value \n";} - print $fh "$indent $group \n"; + print $fh "$indent $group \n"; print $fh "$indent $desc \n"; print $fh "$indent \n"; } From 7c39f5785cc0fdcf1a50397fe8dee7278464ec8b Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Fri, 4 Mar 2016 14:19:02 -0700 Subject: [PATCH 40/46] correct comparison error --- cime_config/cesm/machines/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/cesm/machines/Makefile b/cime_config/cesm/machines/Makefile index 047cafa64e3..7161063bc37 100644 --- a/cime_config/cesm/machines/Makefile +++ b/cime_config/cesm/machines/Makefile @@ -639,7 +639,7 @@ test_esmf: test_esmf.o # create list of component libraries #------------------------------------------------------------------------------ CLMVER = $(filter $(CLM_CONFIG_OPTS), clm5_0 clm4_5) -ifeq ($(CLMVER),'') +ifeq ($(CLMVER),$(null)) LNDOBJDIR = $(EXEROOT)/lnd/obj LNDLIBDIR=$(LIBROOT) LNDLIB := liblnd.a From 908c619284c37754fe4860fcc0214dca1aedf58a Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 7 Mar 2016 10:15:10 -0700 Subject: [PATCH 41/46] do not clean shared land library in a test --- scripts/Tools/clean_build | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/Tools/clean_build b/scripts/Tools/clean_build index f82dd2db101..8ac6ee5cc14 100755 --- a/scripts/Tools/clean_build +++ b/scripts/Tools/clean_build @@ -15,7 +15,7 @@ $ENV{COMP_INTERFACE} = `./xmlquery COMP_INTERFACE -value `; $ENV{BUILD_THREADED} = `./xmlquery BUILD_THREADED -value`; $ENV{PIO_VERSION} = `./xmlquery PIO_VERSION -value`; $ENV{CLM_CONFIG_OPTS} = `./xmlquery CLM_CONFIG_OPTS -value`; - +my $testcase = `./xmlquery TESTCASE -value`; sub usage { die <= 1){ From 34e9111a66878d1dfea6a6416a4f0a4d4b3f4e0e Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 7 Mar 2016 10:40:17 -0700 Subject: [PATCH 42/46] correct syntax in clean_build --- scripts/Tools/clean_build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Tools/clean_build b/scripts/Tools/clean_build index 8ac6ee5cc14..dc1805d3a2a 100755 --- a/scripts/Tools/clean_build +++ b/scripts/Tools/clean_build @@ -87,7 +87,7 @@ if( $cnt==0){ $opts{ice} = 1; $opts{rof} = 1; # Do not clean shared land library in a test case unless explicitly requested - if(not defined $testcase or $ENV{CLM_CONFIG_OPTS} ~= /clm4_0/){ + if(not defined $testcase or ($ENV{CLM_CONFIG_OPTS} =~ /clm4_0/)){ $opts{lnd} = 1; } } From 8917e74e0e0cf5af26285a074b2b0e22d1d24d46 Mon Sep 17 00:00:00 2001 From: Jim Edwards Date: Mon, 7 Mar 2016 13:38:20 -0700 Subject: [PATCH 43/46] address issue #386 with this new variable --- driver_cpl/cime_config/config_component.xml | 16 +++++++++++++--- utils/perl5lib/Batch/BatchUtils.pm | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index 81bd0eecc64..fed1ae7c24b 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -424,6 +424,18 @@
+ + logical + TRUE + run_begin_stop_restart + env_run.xml + This flag controls whether the RESUBMIT flag causes + CONTINUE_RUN to toggle from FALSE to TRUE. The default is + TRUE. This flag might be used in conjunction with COMP_RUN_BARRIERS for + timing tests. + + + logical run_begin_stop_restart @@ -904,9 +916,7 @@ env_run.xml Turns on component barriers for component timing. This variable is for testing and debugging only and should never - be set for a production run. It has a side effect of causing - resubmit not to toggle the CONTINUE_RUN flag so that the RESUBMIT - flag can be used to run several identical runs for timing purposes. + be set for a production run. diff --git a/utils/perl5lib/Batch/BatchUtils.pm b/utils/perl5lib/Batch/BatchUtils.pm index 20cdb9bc3c3..df50219bc87 100755 --- a/utils/perl5lib/Batch/BatchUtils.pm +++ b/utils/perl5lib/Batch/BatchUtils.pm @@ -239,11 +239,11 @@ sub _decrementResubmitCounter() } my $owd = getcwd; chdir $config->{'CASEROOT'}; - if($config->{COMP_RUN_BARRIERS} ne "TRUE") + if($config->{RESUBMIT_SETS_CONTINUE_RUN} eq "TRUE") { `./xmlchange -noecho CONTINUE_RUN=TRUE`; }else{ - $logger->warn("NOT changing CONTINUE_RUN since COMP_RUN_BARRIERS is on") + $logger->warn("NOT changing CONTINUE_RUN since RESUBMIT_SETS_CONTINUE_RUN is FALSE") } `./xmlchange -noecho RESUBMIT=$newresubmit`; if($?) From d75ba3fadd39eba42d47f1b34ed2210ccfd31b8a Mon Sep 17 00:00:00 2001 From: Alice Bertini Date: Mon, 7 Mar 2016 14:47:58 -0700 Subject: [PATCH 44/46] fix testreporter.pl, SMS and PFS test output, cori queue settings Modify testreporter.pl to output true test functionality summary and ---- when tests are not run. Update SMS and PFS to ouput test functionality summary to the caseroot TestStatus file. Update cori queue settings in config_machines.xml. Remove NCR test because it never worked. Remove Ld11 from testlist. Add testlist.xsd schema. Test suite: reran testreporter for cesm1_5_alpha06b YS/intel results Test baseline: N/A Test namelist changes: N/A Test status: bit for bit Fixes: partial fix to #257 Code review: Chris Fischer --- .../cesm/allactive/testlist_allactive.xml | 11 ++-- cime_config/cesm/machines/config_machines.xml | 14 +---- cime_config/xml_schemas/testlist.xsd | 58 +++++++++++++++++++ scripts/Testing/Testcases/PFS_script | 2 + scripts/Testing/Testcases/SMS_script | 2 + scripts/Testing/testreporter.pl | 34 +++++------ 6 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 cime_config/xml_schemas/testlist.xsd diff --git a/cime_config/cesm/allactive/testlist_allactive.xml b/cime_config/cesm/allactive/testlist_allactive.xml index 193d0af5bb4..b8e2bc3c842 100644 --- a/cime_config/cesm/allactive/testlist_allactive.xml +++ b/cime_config/cesm/allactive/testlist_allactive.xml @@ -26,9 +26,6 @@ edison - - yellowstone - yellowstone @@ -60,7 +57,7 @@ - + bluewaters @@ -128,7 +125,7 @@ - + yellowstone @@ -141,7 +138,7 @@ - + yellowstone @@ -249,7 +246,7 @@ - + yellowstone diff --git a/cime_config/cesm/machines/config_machines.xml b/cime_config/cesm/machines/config_machines.xml index e019ef35005..f1aafef6cd7 100644 --- a/cime_config/cesm/machines/config_machines.xml +++ b/cime_config/cesm/machines/config_machines.xml @@ -556,19 +556,11 @@ 32 - regular - + regular + debug - 04:00:00 - + 00:30:00 diff --git a/cime_config/xml_schemas/testlist.xsd b/cime_config/xml_schemas/testlist.xsd new file mode 100644 index 00000000000..3abfa3be224 --- /dev/null +++ b/cime_config/xml_schemas/testlist.xsd @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/scripts/Testing/Testcases/PFS_script b/scripts/Testing/Testcases/PFS_script index 461c742c735..72a3646db7f 100755 --- a/scripts/Testing/Testcases/PFS_script +++ b/scripts/Testing/Testcases/PFS_script @@ -45,10 +45,12 @@ endif #====================================================================== echo "DONE ${CASEBASEID} : (test finished, successful coupler log) " >>& $TESTSTATUS_LOG +echo "PASS ${CASEBASEID} : test functionality summary " >>& $TESTSTATUS_LOG echo "" >>& $TESTSTATUS_LOG echo "DONE ${CASEBASEID} : (test finished, successful coupler log) " >&! $TESTSTATUS_OUT echo "--- Test Functionality: ---" >>& $TESTSTATUS_OUT +echo "PASS ${CASEBASEID} : test functionality summary " >>& $TESTSTATUS_OUT echo "this test just measures performance - so there are no PASS/FAIL metrics" diff --git a/scripts/Testing/Testcases/SMS_script b/scripts/Testing/Testcases/SMS_script index 0af7e49f260..30c27fcaaf4 100755 --- a/scripts/Testing/Testcases/SMS_script +++ b/scripts/Testing/Testcases/SMS_script @@ -68,6 +68,7 @@ if ! ( $?IOP_ON ) then endif echo "DONE ${CASEBASEID} : ($msg finished, successful coupler log) " >>& $TESTSTATUS_LOG +echo "PASS ${CASEBASEID} : test functionality summary " >>& $TESTSTATUS_LOG echo "" >>& $TESTSTATUS_LOG if ( $?IOP_ON ) then @@ -76,6 +77,7 @@ if ( $?IOP_ON ) then $SCRIPTSROOT/Tools/component_compare_test.sh -rundir $RUNDIR -testcase $CASE -testcase_base $CASEBASEID -suffix1 base -suffix2 none $add_iop -msg "$msg" >>& $TESTSTATUS_OUT else echo "PASS ${CASEBASEID} : successful coupler log " >>& $TESTSTATUS_OUT + echo "PASS ${CASEBASEID} : test functionality summary " >>& $TESTSTATUS_OUT endif diff --git a/scripts/Testing/testreporter.pl b/scripts/Testing/testreporter.pl index 183a851b3d0..620e8572ec9 100755 --- a/scripts/Testing/testreporter.pl +++ b/scripts/Testing/testreporter.pl @@ -184,7 +184,6 @@ sub getTestDirs #------------------------------------------------------------------------------- # Get the suite info and send it back. -# Also get the expectedfails file #------------------------------------------------------------------------------- sub getTestSuiteInfo { @@ -244,16 +243,6 @@ sub getTestSuiteInfo my @bltagnodes = $root->findnodes('/testlist/baselinetag'); $caseinfo{'baselinetag'} = $bltagnodes[0]->textContent(); &Debug( "baselinetag: $caseinfo{'baselinetag'}\n") ; - - # Get the expectedFailsFile. - if(! defined $expectedFailsFile) - { - my @cimeroots = $root->findnodes('/testlist/cimeroot'); - die "cannot find cimeroot!" if(! @cimeroots); - my $cimeroot = $cimeroots[0]->textContent(); - &Debug("cimeroot: $cimeroot\n"); - $expectedFailsFile = "$cimeroot/cime_config/cesm/ExpectedTestFails.xml"; - } &Debug("caseinfo: " . eval { Dumper \%caseinfo} ); return %caseinfo; @@ -309,17 +298,22 @@ sub getTestStatus # test functionality summary as the teststatus field. my @testsummarylines = grep { /test functionality summary/ } @statuslines; my $testsummary = (split(/\s+/, $testsummarylines[0]))[0]; - if((defined $testsummary && $testsummary !~ /PASS/) && ($teststatus !~ /DONE/)) + if(defined $testsummary && $testsummary !~ /PASS/) { - $teststatus = $testsummary; + ##$teststatus = $testsummary; $teststatushash{$testcase}{'comment'} = "Overall Test status failed! Check the history files!!"; } - $teststatushash{$testcase}{'status'} = $teststatus; + ##$teststatushash{$testcase}{'status'} = $teststatus; + if(length($testsummary) == 0) + { + $testsummary = 'FAIL'; + } + $teststatushash{$testcase}{'status'} = $testsummary; # Get the baseline compare summary my @comparelines = grep { /baseline compare summary/} @statuslines; my ($comparestatus,$comparetest) = split(/\s+/, $comparelines[0]); - $teststatushash{$testcase}{'compare'} = $comparestatus; + $teststatushash{$testcase}{'compare'} = (length($comparestatus) > 0) ? $comparestatus : "----"; my $comparetag = (split(/\./, $comparetest))[-1]; $baselinetag = $comparetag unless defined $baselinetag; @@ -330,20 +324,20 @@ sub getTestStatus { my @memleaklines = grep { /memleak/ } @statuslines; my $memleakstatus = (split(/\s+/, $memleaklines[0]))[0]; - $teststatushash{$testcase}{'memleak'} = $memleakstatus; + $teststatushash{$testcase}{'memleak'} = (length($memleakstatus) > 0) ? $memleakstatus : "----"; my @memcomplines = grep { /memcomp/} @statuslines; my $memcompstatus = (split(/\s+/, $memcomplines[0]))[0]; - $teststatushash{$testcase}{'memcomp'} = $memcompstatus; + $teststatushash{$testcase}{'memcomp'} = (length($memcompstatus) > 0) ? $memcompstatus : "----"; my @tputcomplines = grep { /tputcomp/ } @statuslines; my $tputcompstatus = (split(/\s+/, $tputcomplines[0]))[0]; - $teststatushash{$testcase}{'tputcomp'} = $tputcompstatus; + $teststatushash{$testcase}{'tputcomp'} = (length($tputcompstatus) > 0) ? $tputcompstatus : "----"; } my @nlcomplines = grep { /nlcomp/i } @statuslines; my $nlcompstatus = (split(/\s+/, $nlcomplines[0]))[0]; - $teststatushash{$testcase}{'nlcomp'} = $nlcompstatus; + $teststatushash{$testcase}{'nlcomp'} = (length($nlcompstatus) > 0) ? $nlcompstatus : "----"; my @commentlines = grep { /COMMENT/ } @statuslines; my $comment = (split(/\s+/, $commentlines[0], 2) )[1]; @@ -394,7 +388,7 @@ sub getTestStatus @memleaklines = grep { /memleak/ } @statuslines; $memleakstatus = (split(/\s+/, $memleaklines[0]))[0]; - $teststatushash{$testcase}{'iopmemleak'} = $memleakstatus; + $teststatushash{$testcase}{'iopmemleak'} = (length($memleakstatus) > 0) ? $memleakstatus : "---"; @comparelines = grep { /compare_hist/} @statuslines; ($comparestatus,$comparetest) = split(/\s+/, $comparelines[0]); From f82337fc45bad0b0941dd70d8d64273b5b616049 Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 8 Mar 2016 13:24:14 -0700 Subject: [PATCH 45/46] Add in drv_flds namelist definition --- .../namelist_definition_drv_flds.xml | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 driver_cpl/bld/namelist_files/namelist_definition_drv_flds.xml diff --git a/driver_cpl/bld/namelist_files/namelist_definition_drv_flds.xml b/driver_cpl/bld/namelist_files/namelist_definition_drv_flds.xml new file mode 100644 index 00000000000..db0577a33c6 --- /dev/null +++ b/driver_cpl/bld/namelist_files/namelist_definition_drv_flds.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + +File containing MEGAN emissions factors. Includes the list of MEGAN compounds that can be +used in the Comp_Name variable on the file. + + + +MEGAN specifier. This is in the form of: Chem-compound = megan_compound(s) +where megan_compound(s) can be the sum of megan compounds with a "+" between them. +In each equation, the item to the left of the equal sign is a CAM chemistry compound, the +items to the right are compounds known to the MEGAN model (single or combinations). +For example, +megan_specifier = 'ISOP = isoprene', + 'C10H16 = pinene_a + carene_3 + thujene_a' + + + +MEGAN mapped isoprene emissions factors switch +If TRUE then use mapped MEGAN emissions factors for isoprene. + + + +List of possible MEGAN compounds to use + (the list used by the simulation is on the megan_factors_file as the Comp_Name) + + + + + + + +Where dry deposition is calculated (from land, atmosphere, or from a table) +This specifies the method used to calculate dry +deposition velocities of gas-phase chemical species. The available methods +are: + 'table' - prescribed method in CAM + 'xactive_atm' - interactive method in CAM + 'xactive_lnd' - interactive method in CLM + + + + +List of species that undergo dry deposition. + + + + + + + +File containing fire emissions factors. +Default: none + + + +Fire emissions specifier. +Default: none + + + +If ture fire emissions are input into atmosphere as elevated forcings. +Otherwise they are treated as surface emissions. +Default: TRUE + + + + + + + +List of fluxes needed by the CARMA model, from CLM to CAM. + + + From 30280240c920119b0b75f615101c1305e2d773ad Mon Sep 17 00:00:00 2001 From: Erik Kluzek Date: Tue, 8 Mar 2016 14:25:23 -0700 Subject: [PATCH 46/46] Add setting of BARRIER for I compsets --- driver_cpl/cime_config/config_component.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/driver_cpl/cime_config/config_component.xml b/driver_cpl/cime_config/config_component.xml index fed1ae7c24b..5d67afeb952 100644 --- a/driver_cpl/cime_config/config_component.xml +++ b/driver_cpl/cime_config/config_component.xml @@ -368,6 +368,9 @@ sets frequency of full model barrier (same options as STOP_OPTION) for synchronization with BARRIER_N and BARRIER_DATE + + ndays +
@@ -378,6 +381,9 @@ sets periodic model barriers with BARRIER_OPTION and BARRIER_DATE for synchronization + + 1 +