From 6657baaf8c642e1f0f900dcbb647162137b8441c Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Mon, 10 Jan 2022 10:30:40 -0500 Subject: [PATCH 01/38] buf fis for format and make_bcs better desription --- .../Utils/Raster/make_bcs | 9 ++++++--- .../Utils/Raster/mkCatchParam.F90 | 20 +++++++++---------- .../Utils/Raster/mod_process_hres_data.F90 | 2 +- .../Utils/Raster/rmTinyCatchParaMod.F90 | 11 ++++++++-- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index d8b17283b..c728eca0b 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -144,6 +144,8 @@ echo " ${C2}ICA -- for /discover/nobackup/ltakacs/bcs/Icarus/" echo " ${C2}NL3 -- for /discover/nobackup/ltakacs/bcs/Icarus-NLv3/" echo " ${C2}NL4 -- for /discover/nobackup/projects/gmao/smap/bcs_temporary/NLv4/" echo " ${C2} equivalent parameter configuration and ancillary data." +echo " ${C2}NL5 -- as NL4 + peatlands" +echo " ${C2}DEV -- boundary conditions development branch" echo " " echo " NOTE: Due to compiler differences, code improvements and bug fixes that" echo " have taken place since the above archived BCs were created, some parameter " @@ -152,11 +154,12 @@ echo " Nevertheless, the impact of those differences on scien echo " the parameter files produced by current source codes can be considered as " echo " scientifically equivalent to achieved BCs" echo " " -echo " (OR press ENTER If you want to use the develop version of land BCs.)" +echo " (OR press ENTER If you want to use suggested version of land BCs.)" +echo " (ENTER will choose DEF - Default BCS and that is NLv3.)" set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` set lbcsv = DEF -if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL4p') set lbcsv = $dummy +if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5', $dummy == 'DEV') set lbcsv = $dummy ####################################################################### @@ -263,7 +266,7 @@ else endif if($HRCODES == m1 | $HRCODES == m3 | $HRCODES == m9 | $HRCODES == m36 | $HRCODES == m25) then - set GLOBAL_CATCH_DATA = ${l_data}/GEOS5_10arcsec_mask.nc + set GLOBAL_CATCH_DATA = ${l_data}/GEOS5_10arcsec_mask_freshwater-lakes.nc endif set MASKFILE = `echo ${GLOBAL_CATCH_DATA} | rev | cut -d / -f1 | rev ` diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 73030e0bd..4f0b69c4b 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -9,7 +9,7 @@ PROGRAM mkCatchParam ! -y: Size of latitude dimension of input raster. DEFAULT: 4320 ! -b: position of the dateline in the first box. DEFAULT: DC ! -g: Gridname (name of the .til or .rst file without file extension) -! -v: LBCSV : use a configuration from GEOS5 bcs directory ICA, NL3, NL4, or NL4p +! -v: LBCSV : use a configuration from GEOS5 bcs directory ICA, NL3, NL4, NL5, development or default ! -e: EASE : This is optional if catchment.def file is available already or ! the til file format is pre-Fortuna-2. ! @@ -98,14 +98,14 @@ PROGRAM mkCatchParam ! call system('cd data/ ; ln -s /discover/nobackup/projects/gmao/ssd/land/l_data/LandBCs_files_for_mkCatchParam/V001/ CATCH') ! call system('cd ..') - USAGE(1) ="Usage: mkCatchParam -x nx -y ny -g Gridname -b DL -v LBCSV -e EASE " - USAGE(2) =" -x: Size of longitude dimension of input raster. DEFAULT: 8640 " - USAGE(3) =" -y: Size of latitude dimension of input raster. DEFAULT: 4320 " - USAGE(4) =" -g: Gridname (name of the .til or .rst file without file extension) " - USAGE(5) =" -b: Position of the dateline in the first grid box (DC or DE). DEFAULT: DC " - USAGE(6) =" -e: EASE : This is optional if catchment.def file is available already or " - USAGE(7) =" the til file format is pre-Fortuna-2. " - USAGE(8) =" -v LBCSV : use a configuration from GEOS5 bcs directory F25, GM4, ICA, NL3, NL4, or NL4p " + USAGE(1) ="Usage: mkCatchParam -x nx -y ny -g Gridname -b DL -v LBCSV -e EASE " + USAGE(2) =" -x: Size of longitude dimension of input raster. DEFAULT: 8640 " + USAGE(3) =" -y: Size of latitude dimension of input raster. DEFAULT: 4320 " + USAGE(4) =" -g: Gridname (name of the .til or .rst file without file extension) " + USAGE(5) =" -b: Position of the dateline in the first grid box (DC or DE). DEFAULT: DC " + USAGE(6) =" -e: EASE : This is optional if catchment.def file is available already or " + USAGE(7) =" the til file format is pre-Fortuna-2. " + USAGE(8) =" -v LBCSV : use a configuration from GEOS5 bcs directory F25, GM4, ICA, NL3, NL4, NL5, DEV or DEF " ! Process Arguments !------------------ @@ -338,7 +338,7 @@ PROGRAM mkCatchParam inquire(file='clsm/ndvi.dat', exist=file_exists) if (.not.file_exists) call gimms_clim_ndvi (nc,nr,gridnamer) - write (log_file,'(a,a,a)')'Done computing ', trim(LAIBCS),' vegetation climatologies .............4' + write (log_file,'(a,a,a)')'Done computing ', trim(LAIBCS),' vegetation climatologies ............4' ! call modis_alb_on_tiles (nc,nr,ease_grid,regrid,gridnamet,gridnamer) ! call modis_scale_para (ease_grid,gridnamet) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 index 74e8c80c0..8b5a6aab9 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 @@ -5754,7 +5754,7 @@ SUBROUTINE CLM45_fixed_parameters (nc,nr,gfiler) if(count_pix(i,3) > 0.) abm_int = NINT(abm (i) / count_pix(i,3)) if(count_pix(i,4) > 0.) hdm_r = hdm (i) / count_pix(i,4) - write (10,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)' ) tid, cid, abm_int, peatf_r, gdp_r, hdm_r, field_cap(sc_com) + write (10,'(2I8, i3, f8.4, f8.2, f10.2, f8.4)' ) tid, cid, abm_int, peatf_r, gdp_r, hdm_r, field_cap(sc_com) end do diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 index 8edc887b9..4839a3556 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 @@ -109,19 +109,26 @@ SUBROUTINE init_bcs_config (LBSV) process_peat = .false. jpl_height = .true. - case ("NL4p") + case ("NL5") LAIBCS = 'MODGEO' SOILBCS = 'HWSD' MODALB = 'MODIS2' process_peat = .true. jpl_height = .true. - case ("DEF") + case ("DEV") LAIBCS = 'MODGEO' SOILBCS = 'HWSD' MODALB = 'MODIS2' process_peat = .true. jpl_height = .true. + + case ("DEF") + LAIBCS = 'MODGEO' + SOILBCS = 'HWSD' + MODALB = 'MODIS2' + process_peat = .false. + jpl_height = .false. end select From 26dca1049f6a2ef4d3b40b4858e604cb898206b1 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Mon, 10 Jan 2022 10:46:49 -0500 Subject: [PATCH 02/38] typo --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index c728eca0b..1450e09cc 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -159,7 +159,7 @@ echo " (ENTER will choose DEF - Default BCS and that is NLv3.)" set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` set lbcsv = DEF -if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5', $dummy == 'DEV') set lbcsv = $dummy +if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') set lbcsv = $dummy ####################################################################### From e95783018a140bd02c96288b08bb7c9ff2786a29 Mon Sep 17 00:00:00 2001 From: Rolf Reichle <54944691+gmao-rreichle@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:42:02 -0500 Subject: [PATCH 03/38] Edited make_bcs interactive questions help text --- .../Utils/Raster/make_bcs | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 1450e09cc..cef057875 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -2,8 +2,8 @@ ####################################################################### # This script creates surface tiles, and writes all model input files -# (.til, .rst and land parameter) in BCSDIR for any specified -# combination of atmospheric and ocean grid resolutions. +# (.til [tiles], .rst [raster] and land parameters) in BCSDIR for any +# specified combination of atmospheric and ocean grid resolutions. # # ---- USAGE ---- # 1) STEP 1 : build the model. @@ -72,7 +72,7 @@ set pwd = `pwd` HRCODE: echo " " -echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR} to be build:" +echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR} to be built:" echo "------------------------------------------------------------------------------------------------------------------" echo " Lat/Lon Cubed-Sphere EASE (land-only)" echo "------------------------------------------------------------------------------------------------------------------" @@ -138,27 +138,25 @@ endif LBCSV: echo echo "Enter 3-character alphanumeric code to select specific ${C1}Land BCs version ${CR} to use:" -echo " Choose: ${C2}F25 -- for Fortuna-2_5" -echo " ${C2}GM4 -- for /discover/nobackup/ltakacs/bcs/Ganymed-4_0/" -echo " ${C2}ICA -- for /discover/nobackup/ltakacs/bcs/Icarus/" -echo " ${C2}NL3 -- for /discover/nobackup/ltakacs/bcs/Icarus-NLv3/" -echo " ${C2}NL4 -- for /discover/nobackup/projects/gmao/smap/bcs_temporary/NLv4/" -echo " ${C2} equivalent parameter configuration and ancillary data." -echo " ${C2}NL5 -- as NL4 + peatlands" -echo " ${C2}DEV -- boundary conditions development branch" -echo " " +echo " Choose: ${C2}F25 : Fortuna-2_5" +echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" +echo " ${C2}ICA : Icarus (/discover/nobackup/ltakacs/bcs/Icarus/)" +echo " ${C2}NL3 : Icarus-NLv3 (/discover/nobackup/ltakacs/bcs/Icarus-NLv3/)" +echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_temporary/NLv4/)" +echo " ${C2}NL5 : NLv5 [SMAP]" +echo " ${C2}DEV : development version" +echo " " echo " NOTE: Due to compiler differences, code improvements and bug fixes that" -echo " have taken place since the above archived BCs were created, some parameter " -echo " files produced by current source codes may differ with those in the archived BCs." -echo " Nevertheless, the impact of those differences on science is insignificant and" -echo " the parameter files produced by current source codes can be considered as " -echo " scientifically equivalent to achieved BCs" +echo " have taken place since the above archived BCs were created, some parameter" +echo " files produced by current source code may differ from those in the archived BCs." +echo " Nevertheless, the impact of these differences on science is insignificant and" +echo " the parameter files produced by current source code is considered to be" +echo " scientifically equivalent to the corresponding archived BCs" echo " " -echo " (OR press ENTER If you want to use suggested version of land BCs.)" -echo " (ENTER will choose DEF - Default BCS and that is NLv3.)" +echo " OR press ENTER to select NL3 (current default)." set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` -set lbcsv = DEF +set lbcsv = NL3 if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') set lbcsv = $dummy ####################################################################### @@ -171,7 +169,7 @@ else ORSLV: echo - echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR} to be build:" + echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR} to be built:" echo " Choose: ${C2}O1 -- Low-Resolution Reynolds 1 deg${CR} (Lon/Lat Data-Ocean: 360x180) " echo " ${C2}O2 -- Med-Resolution Reynolds 1/4 deg${CR} (Lon/Lat Data-Ocean: 1440x720) " echo " ${C2}O3 -- High-Resolution OSTIA 1/8 deg${CR} (Lon/Lat Data-Ocean: 2880x1440) " From 646277463b7323ee0a186a76ddfc4049ab6f7e1a Mon Sep 17 00:00:00 2001 From: Rolf Reichle <54944691+gmao-rreichle@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:46:23 -0500 Subject: [PATCH 04/38] Edited "usage" help text in mkCatchParam.F90 --- .../GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 4f0b69c4b..3f17604b4 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -9,7 +9,7 @@ PROGRAM mkCatchParam ! -y: Size of latitude dimension of input raster. DEFAULT: 4320 ! -b: position of the dateline in the first box. DEFAULT: DC ! -g: Gridname (name of the .til or .rst file without file extension) -! -v: LBCSV : use a configuration from GEOS5 bcs directory ICA, NL3, NL4, NL5, development or default +! -v: LBCSV : Choose bcs version (ICA, NL3, NL4, NL5, or development) ! -e: EASE : This is optional if catchment.def file is available already or ! the til file format is pre-Fortuna-2. ! @@ -105,7 +105,7 @@ PROGRAM mkCatchParam USAGE(5) =" -b: Position of the dateline in the first grid box (DC or DE). DEFAULT: DC " USAGE(6) =" -e: EASE : This is optional if catchment.def file is available already or " USAGE(7) =" the til file format is pre-Fortuna-2. " - USAGE(8) =" -v LBCSV : use a configuration from GEOS5 bcs directory F25, GM4, ICA, NL3, NL4, NL5, DEV or DEF " + USAGE(8) =" -v LBCSV : Choose bcs version (F25, GM4, ICA, NL3, NL4, NL5, or DEV) " ! Process Arguments !------------------ From 7af27bac78690bcc6f3b94be7f9566ef63777953 Mon Sep 17 00:00:00 2001 From: Rolf Reichle <54944691+gmao-rreichle@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:48:26 -0500 Subject: [PATCH 05/38] Removed redundant definition of DEF[ault] in rmTinyCatchParaMod.F90 --- .../Utils/Raster/rmTinyCatchParaMod.F90 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 index 4839a3556..940506647 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 @@ -122,13 +122,6 @@ SUBROUTINE init_bcs_config (LBSV) MODALB = 'MODIS2' process_peat = .true. jpl_height = .true. - - case ("DEF") - LAIBCS = 'MODGEO' - SOILBCS = 'HWSD' - MODALB = 'MODIS2' - process_peat = .false. - jpl_height = .false. end select From a42ebcb48d441aa64eceb4b18723b4d9c040ddd4 Mon Sep 17 00:00:00 2001 From: Rolf Reichle <54944691+gmao-rreichle@users.noreply.github.com> Date: Tue, 11 Jan 2022 09:24:39 -0500 Subject: [PATCH 06/38] cleanup & comments (interactive questions make_bcs) --- .../Utils/Raster/make_bcs | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index cef057875..bb88d594e 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -69,6 +69,8 @@ set CR = $RESET set pwd = `pwd` ####################################################################### +# +# Atmospheric Horizontal Resolution (HRCODE) HRCODE: echo " " @@ -134,6 +136,11 @@ if( $HRCODE == o ) then endif ####################################################################### +# +# Land bcs version (LBCSV) + +# set default land bcs version +set lbcsv = NL3 LBCSV: echo @@ -153,11 +160,15 @@ echo " Nevertheless, the impact of these differences on scien echo " the parameter files produced by current source code is considered to be" echo " scientifically equivalent to the corresponding archived BCs" echo " " -echo " OR press ENTER to select NL3 (current default)." +echo " OR press ENTER to select $lbcsv (current default)." set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` -set lbcsv = NL3 -if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') set lbcsv = $dummy +if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') then + set lbcsv = $dummy +else + echo "You selected lbcsv=$dummy !!!! Invalid Version, stopping !!!! " + exit +endif ####################################################################### @@ -166,6 +177,10 @@ if($HRCODES == m1 | $HRCODES == m3 | $HRCODES == m9 | $HRCODES == m36 | $HRCODES else +####################################################################### +# +# Ocean Horizontal Resolution (ORSLV) + ORSLV: echo From dff574f2a9cae0b93a68ddff78f303af103b145f Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Tue, 11 Jan 2022 11:12:47 -0500 Subject: [PATCH 07/38] edit --- .../GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 3f17604b4..3750f7d71 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -338,7 +338,7 @@ PROGRAM mkCatchParam inquire(file='clsm/ndvi.dat', exist=file_exists) if (.not.file_exists) call gimms_clim_ndvi (nc,nr,gridnamer) - write (log_file,'(a,a,a)')'Done computing ', trim(LAIBCS),' vegetation climatologies ............4' + write (log_file,'(a,a,a)')'Done computing ', trim(LAIBCS),' vegetation climatologies .............4' ! call modis_alb_on_tiles (nc,nr,ease_grid,regrid,gridnamet,gridnamer) ! call modis_scale_para (ease_grid,gridnamet) From d2ec64f704f5188c61c23b1533832cb7f31ed638 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Tue, 11 Jan 2022 12:11:16 -0500 Subject: [PATCH 08/38] diff run setup --- .../Utils/Raster/make_bcs | 94 ++++++++++++++++--- 1 file changed, 79 insertions(+), 15 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index bb88d594e..f1309edfb 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -7,8 +7,7 @@ # # ---- USAGE ---- # 1) STEP 1 : build the model. -# 2) STEP 2 : create a link to install/bin from the working directory. -# 3) STEP 3 : bin/make_bcs +# 2) STEP 2 : ./make_bcs # Answer the following questions: # a) Enter the Atmospheric Horizontal Resolution Code(s) to build: # b) Select the Land BCs version to use: @@ -27,8 +26,8 @@ if ( $1 == noland ) set SKIPLAND = YES # Set GEOS5/ESMADIR Variables ####################################################################### -set MAKE_BCS = `echo $cwd`/bin/make_bcs -set ESMADIR = `echo $cwd`/bin/ +set MAKE_BCS = `echo $cwd`/make_bcs +set ESMADIR = `echo $cwd` echo ' ' echo MAKE_BCS: $MAKE_BCS @@ -59,15 +58,80 @@ set WHITE = "\033[37m" set RESET = "\033[0m" set BOLD = "\033[1m" -set C1 = $RED -set C2 = $BLUE -set CR = $RESET - ####################################################################### ####################################################################### set pwd = `pwd` +if( -e $HOME/.make_bcs) then + set make_bcsinfo = `cat $HOME/.make_bcs` + set C1 = $make_bcsinfo[1] + set C2 = $make_bcsinfo[2] +else + set C1 = $RED + set C2 = $BLUE +endif + set CR = $RESET +####################################################################### +# Build Directory Locations +####################################################################### + +# Set Current Working Path to make_bcs +# ------------------------------------- +setenv ARCH `uname -s` +if ($ARCH == Darwin) then + set FINDPATH = realpath +else + set FINDPATH = 'readlink -f' +endif +set MAKE_BCS = `$FINDPATH $0` + +# Test if GEOSgcm.x or GEOSldas.x are here which means you are in install directory +if (! -x GEOSgcm.x && ! -x GEOSldas.x) then + echo "You are trying to run $0 from the wrong directory" + echo "Please run from the bin/ directory in your installation" + exit 1 +endif +####################################################################### +# Create Paths for EXP Directorie +####################################################################### +echo +echo "Enter the ${C1}Boundary Conditions Directory Name${CR}:" +set EXPID = $< + +# EXP Directory (for Output Data ) +# -------------------------------------------- + set check = FALSE +while( $check == FALSE ) + if( -e $HOME/.EXPDIRroot ) then + set EXPDIRroot = `cat $HOME/.EXPDIRroot` + else + set EXPDIRroot = $WRKDIR + endif + setenv EXPDIR_def $EXPDIRroot/$EXPID + echo "" + echo "Enter Desired Location for the ${C1}EXPERIMENT${CR} Directory (to contain BC's output)" + echo "Hit ENTER to use Default Location:" + echo "----------------------------------" + echo "Default: ${C2}${EXPDIR_def}${CR}" + set NUEXPDIR = $< + if( .$NUEXPDIR != . ) then + setenv EXPDIR $NUEXPDIR + setenv EXPDIR_def $NUEXPDIR + else + setenv EXPDIR $EXPDIR_def + endif + + if( "$EXPID" != `basename $EXPDIR` ) then + echo "\!\! The ${C1}EXPERIMENT${CR} Directory MUST point to the ${C1}EXPID${CR}: ${C2}${EXPID}${CR}" + echo " " + else + set check = TRUE + endif +end +mkdir -p $EXPDIR + + ####################################################################### # # Atmospheric Horizontal Resolution (HRCODE) @@ -563,7 +627,7 @@ set IMO = `echo ${imo} | awk '{printf "%4.4i", $1}'` set JMO = `echo ${jmo} | awk '{printf "%4.4i", $1}'` set BCNAME = DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO} -set BCDIR = $OUTDIR/$BCNAME.scratch +set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j if( -e $BCDIR) /bin/rm -r $BCDIR @@ -588,7 +652,7 @@ setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR -/bin/ln -s $pwd/bin +/bin/ln -s $pwd mkdir -p til rst data/MOM5 data/MOM6 clsm/plots ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/360x200 data/MOM5/360x200 ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/720x410 data/MOM5/720x410 @@ -738,7 +802,7 @@ else set BCNAME = CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO} endif -set BCDIR = $OUTDIR/$BCNAME.scratch +set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j if( -e $BCDIR) /bin/rm -r $BCDIR @@ -764,7 +828,7 @@ setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR -/bin/ln -s $pwd/bin +/bin/ln -s $pwd mkdir -p til rst data/MOM5 data/MOM6 clsm/plots ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/360x200 data/MOM5/360x200 ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/720x410 data/MOM5/720x410 @@ -965,7 +1029,7 @@ setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR -/bin/ln -s $pwd/bin +/bin/ln -s $pwd mkdir -p til rst data/MOM5 data/MOM6 clsm/plots ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/360x200 data/MOM5/360x200 ln -s /discover/nobackup/projects/gmao/ssd/aogcm/ocean_bcs/MOM5/720x410 data/MOM5/720x410 @@ -1135,7 +1199,7 @@ set IM = `echo ${im} | awk '{printf "%4.4i", $1}'` set JM = `echo ${jm} | awk '{printf "%4.4i", $1}'` set BCNAME = SMAP_${EVERSION}_${MGRID} -set BCDIR = $OUTDIR/$BCNAME.scratch +set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j set THISGRID = SMAP-${EVERSION}-${MGRID} if( -e $BCDIR) /bin/rm -r $BCDIR @@ -1160,7 +1224,7 @@ setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR -/bin/ln -s $pwd/bin +/bin/ln -s $pwd mkdir -p til rst data/MOM5 data/MOM6 clsm/plots cd data ln -s $l_data CATCH From 4f1984101dc4fdb8188d01648bf0b0f0f6bb1bc8 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Tue, 11 Jan 2022 16:56:26 -0500 Subject: [PATCH 09/38] revised status messages in mkCatchParam.F90 --- .../Utils/Raster/mkCatchParam.F90 | 153 ++++++++++++++---- 1 file changed, 120 insertions(+), 33 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 3750f7d71..df967e27c 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -218,16 +218,26 @@ PROGRAM mkCatchParam if(.not.ease_grid) then inquire(file='clsm/catchment.def', exist=file_exists) - if (.not.file_exists) call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) - write (log_file,'(a)')'Done creating catchment.def file ..........................1' + if (.not.file_exists) then + write (log_file,'(a)')'Creating catchment.def file...' + call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing catchment.def file.' + endif endif ! Creating cti_stats.dat ! ---------------------- inquire(file='clsm/cti_stats.dat', exist=file_exists) - if (.not.file_exists) call cti_stat_file (ease_grid,gridnamet, MaskFile) - write (log_file,'(a)')'Done creating CTI stat file ...............................2' + if (.not.file_exists) then + write (log_file,'(a)')'Creating CTI stats file...' + call cti_stat_file (ease_grid,gridnamet, MaskFile) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing CTI stats file.' + endif ! Creating vegetation classification files !----------------------------------------- @@ -235,25 +245,68 @@ PROGRAM mkCatchParam if (index(MaskFile,'GEOS5_10arcsec_mask') /= 0) then inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) - if (.not.file_exists) call ESA2MOSAIC (nc,nr,gridnamer) + if (.not.file_exists) then + write (log_file,'(a)')'Creating vegetation types using ESA land cover (MOSAIC/Catch).' + call ESA2MOSAIC (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch).' + endif + inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) - if (.not.file_exists) call ESA2CLM (nc,nr,gridnamer) + if (.not.file_exists) then + write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM40).' + call ESA2CLM (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM40).' + endif + inquire(file='clsm/CLM4.5_veg_typs_fracs', exist=file_exists) - if (.not.file_exists) call ESA2CLM_45 (nc,nr,gridnamer) + if (.not.file_exists) then + write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM45).' + call ESA2CLM_45 (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM45).' + endif + write (log_file,'(a)')'Done creating vegetation types using ESA land cover........3' else - + inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) - call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) + if (.not.file_exists) then + write (log_file,'(a)')'Creating vegetation types using IGBP SiB2 land cover (MOSAIC/Catch).' + call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch).' + endif - write (log_file,'(a)')'Done creating vegetation types using IGBP SiB2 land cover..3' + ! Per make_bcs, it looks like there are four possible mask files: + ! + ! GEOS5_10arcsec_mask.nc + ! global.cat_id.catch.DL + ! global.cat_id.catch.GreatLakesCaspian_Updated.DL + ! GEOS5_10arcsec_mask_freshwater-lakes.nc + ! + ! If we are in this else block, we must be using one of the latter three masks. + ! It looks like these latter masks only work for Catchment and not CatchCNCLM[xx] + ! + ! - reichle, 11 Jan 2022 + + write (log_file,'(a)')'NOTE: The selected mask works only for the Catchment model.' + write (log_file,'(a)')' Vegetation types *not* created for CatchCNCLM[xx].' + endif ! Processing Vegetation Climatology ! --------------------------------- ! creating mapping arrays if necessary + + write (log_file,'(a,a)')'Creating vegetation climatologies: ', trim(LAIBCS) if((trim(LAIBCS) == 'MODGEO').or.(trim(LAIBCS) == 'GEOLAND2')) then inquire(file='clsm/lai.GEOLAND2_10-DayClim', exist=file_exists) @@ -338,14 +391,18 @@ PROGRAM mkCatchParam inquire(file='clsm/ndvi.dat', exist=file_exists) if (.not.file_exists) call gimms_clim_ndvi (nc,nr,gridnamer) - write (log_file,'(a,a,a)')'Done computing ', trim(LAIBCS),' vegetation climatologies .............4' - + write (log_file,'(a)')'Done.' + + ! ------------------------------------------------- + ! call modis_alb_on_tiles (nc,nr,ease_grid,regrid,gridnamet,gridnamer) ! call modis_scale_para (ease_grid,gridnamet) ! NOTE: modis_alb_on_tiles uses monthly climatological raster data on 8640x4320 to produce ! MODIS albedo on tile space. The subroutine was replaced with "modis_alb_on_tiles_high" that process ! MODIS1 data on native grid and produces 8/16-day MODIS Albedo climatology + write (log_file,'(a,a)')'Mapping albedo on tile space: ',trim(MODALB) + if(MODALB == 'MODIS1') then inquire(file='clsm/AlbMap.WS.16-day.tile.0.7_5.0.dat', exist=file_exists) if (.not.file_exists) then @@ -365,13 +422,17 @@ PROGRAM mkCatchParam inquire(file='clsm/AlbMap.WS.8-day.tile.0.7_5.0.dat', exist=file_exists) if (.not.file_exists) call modis_alb_on_tiles_high (43200,21600,maparc30,MODALB,gridnamer) endif - write (log_file,'(a,a,a)')'Done putting ',trim(MODALB), ' Albedo on the tile space .............5' + write (log_file,'(a)')'Done.' if(.not.F25Tag) then deallocate (maparc30%map) deallocate (maparc30%ij_index) endif + ! --------------------------------------------- + + write (log_file,'(a)')'Creating albedo scale factors: ',trim(MODALB) + inquire(file='clsm/visdf.dat', exist=file_exists) if ((redo_modis).or.(.not.file_exists)) then ! if(.not.F25Tag) then @@ -386,15 +447,21 @@ PROGRAM mkCatchParam ! endif endif - write (log_file,'(a,a,a)')'Done computing ',trim(MODALB), ' scale factors .......................6' + write (log_file,'(a)')'Done.' ! tmpstring1 = '-e EASE -g '//trim(gfile) ! write(tmpstring2,'(2(a2,x,i5,x))')'-x',nc,'-y',nr ! tmpstring = 'bin/mkCatchParam_openmp '//trim(tmpstring2)//' '//trim(tmpstring1) else - - if(SOILBCS=='NGDC') call create_soil_types_files (nc,nr,ease_grid,gridnamet,gridnamer) - if(SOILBCS=='NGDC') write (log_file,'(a)')'Done creating NGDC soil types file .......................7a' + + ! this block is for n_threads>1 + !============================== + + if(SOILBCS=='NGDC') then + write (log_file,'(a)')'Creating NGDC soil types file...' + call create_soil_types_files (nc,nr,ease_grid,gridnamet,gridnamer) + write (log_file,'(a)')'Done.' + endif ! Creating soil_param.first and tau_param.dat files that has 2 options: ! 1) NGDC soil properties, 2) HWSD-STATSGO2 Soil Properties @@ -402,48 +469,68 @@ PROGRAM mkCatchParam inquire(file='clsm/soil_param.first', exist=file_exists) if (.not.file_exists) then + write (log_file,'(a,a)')'Creating soil parameters: ',trim(SOILBCS) if(SOILBCS=='NGDC') then if(F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) if(.not.F25Tag) call soil_para_high (nc,nr,regrid,gridnamer) - endif - - if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) + endif + if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a,a)')'Using existing soil parameter file.' endif - write (log_file,'(a,a,a)')'Done computing ',trim(SOILBCS),' soil parameters .......................7' - + inquire(file='clsm/ts.dat', exist=file_exists) if (.not.file_exists) then + write (log_file,'(a,a)')'Creating CLSM model parameters: ',trim(SOILBCS) if(SOILBCS=='NGDC') call create_model_para (MaskFile) if(SOILBCS=='HWSD') call create_model_para_woesten (MaskFile) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a,a)')'Using existing CLSM model parameter file.' endif - write (log_file,'(a,a,a)')'Done computing CLSM model parameters based on ',trim(SOILBCS),'.........8' ! Commented out this call because 7.5-minute raster file is only used ! for plotting purposes ! call make_75 (nc,nr,regrid,c_data,gridnamer) ! write (log_file,'(a)')'Done creating 7.5 minute raster file ......................' - ! write (log_file,'(a)')'Not created 7.5 minute raster file ......................' + write (log_file,'(a)')'NOTE: 7.5 minute raster file not created (only needed for diagnostic plotting).' + write (log_file,'(a)')' Uncomment associated lines in source to generate 7.5 minute raster file.' inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) if (file_exists) then - + write (log_file,'(a)')'Creating CLSM-CN NDep T2m SoilAlb file...' call grid2tile_ndep_t2m_alb (nc,nr,gridnamer) - write (log_file,'(a)')'Done computing CLSM-CN NDep T2m SoilAlb ...................9' - + write (log_file,'(a)')'Done.' endif inquire(file='clsm/CLM4.5_abm_peatf_gdp_hdm_fc', exist=file_exists) - if (.not.file_exists) call CLM45_fixed_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done creating CLM4.5_abm_peatf_gdp_hdm_fc ................10' + if (.not.file_exists) then + write (log_file,'(a)')'Creating CLM4.5_abm_peatf_gdp_hdm_fc file...' + call CLM45_fixed_parameters (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing CLM4.5_abm_peatf_gdp_hdm_fc file.' + endif inquire(file='clsm/lnfm.dat', exist=file_exists) - if (.not.file_exists) call CLM45_clim_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done creating CLM4.5 lightening frequency clim ...........11' + if (.not.file_exists) then + write (log_file,'(a)')'Creating CLM4.5 lightning frequency file...' + call CLM45_clim_parameters (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing CLM4.5 lightning frequency file.' + endif inquire(file='clsm/country_and_state_code.data', exist=file_exists) - if (.not.file_exists) call map_country_codes (nc,nr,gridnamer) - write (log_file,'(a)')'Done mapping country and state codes .....................12' + if (.not.file_exists) then + write (log_file,'(a)')'Mapping country and state codes...' + call map_country_codes (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using country and state codes file.' + endif ! inquire(file='clsm/irrig.dat', exist=file_exists) ! if (.not.file_exists) call create_irrig_params (nc,nr,gridnamer) From 0821b7c279a0804a78f5e6b2e8d95cd998de604a Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Tue, 11 Jan 2022 17:08:38 -0500 Subject: [PATCH 10/38] added blank lines to log of status messages in mkCatchParam.F90 --- .../Utils/Raster/mkCatchParam.F90 | 36 ++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index df967e27c..487f5c431 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -225,6 +225,7 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing catchment.def file.' endif + write (log_file,'(a)')' ' endif ! Creating cti_stats.dat @@ -238,6 +239,7 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing CTI stats file.' endif + write (log_file,'(a)')' ' ! Creating vegetation classification files !----------------------------------------- @@ -252,6 +254,7 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch).' endif + write (log_file,'(a)')' ' inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) if (.not.file_exists) then @@ -261,6 +264,7 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM40).' endif + write (log_file,'(a)')' ' inquire(file='clsm/CLM4.5_veg_typs_fracs', exist=file_exists) if (.not.file_exists) then @@ -270,9 +274,8 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM45).' endif + write (log_file,'(a)')' ' - write (log_file,'(a)')'Done creating vegetation types using ESA land cover........3' - else inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) @@ -283,6 +286,7 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch).' endif + write (log_file,'(a)')' ' ! Per make_bcs, it looks like there are four possible mask files: ! @@ -298,7 +302,8 @@ PROGRAM mkCatchParam write (log_file,'(a)')'NOTE: The selected mask works only for the Catchment model.' write (log_file,'(a)')' Vegetation types *not* created for CatchCNCLM[xx].' - + write (log_file,'(a)')' ' + endif ! Processing Vegetation Climatology @@ -392,7 +397,8 @@ PROGRAM mkCatchParam if (.not.file_exists) call gimms_clim_ndvi (nc,nr,gridnamer) write (log_file,'(a)')'Done.' - + write (log_file,'(a)')' ' + ! ------------------------------------------------- ! call modis_alb_on_tiles (nc,nr,ease_grid,regrid,gridnamet,gridnamer) @@ -423,6 +429,7 @@ PROGRAM mkCatchParam if (.not.file_exists) call modis_alb_on_tiles_high (43200,21600,maparc30,MODALB,gridnamer) endif write (log_file,'(a)')'Done.' + write (log_file,'(a)')' ' if(.not.F25Tag) then deallocate (maparc30%map) @@ -448,6 +455,8 @@ PROGRAM mkCatchParam endif write (log_file,'(a)')'Done.' + write (log_file,'(a)')' ' + ! tmpstring1 = '-e EASE -g '//trim(gfile) ! write(tmpstring2,'(2(a2,x,i5,x))')'-x',nc,'-y',nr ! tmpstring = 'bin/mkCatchParam_openmp '//trim(tmpstring2)//' '//trim(tmpstring1) @@ -461,6 +470,7 @@ PROGRAM mkCatchParam write (log_file,'(a)')'Creating NGDC soil types file...' call create_soil_types_files (nc,nr,ease_grid,gridnamet,gridnamer) write (log_file,'(a)')'Done.' + write (log_file,'(a)')' ' endif ! Creating soil_param.first and tau_param.dat files that has 2 options: @@ -471,7 +481,7 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a,a)')'Creating soil parameters: ',trim(SOILBCS) if(SOILBCS=='NGDC') then - if(F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) + if( F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) if(.not.F25Tag) call soil_para_high (nc,nr,regrid,gridnamer) endif if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) @@ -479,6 +489,7 @@ PROGRAM mkCatchParam else write (log_file,'(a,a)')'Using existing soil parameter file.' endif + write (log_file,'(a)')' ' inquire(file='clsm/ts.dat', exist=file_exists) @@ -490,6 +501,7 @@ PROGRAM mkCatchParam else write (log_file,'(a,a)')'Using existing CLSM model parameter file.' endif + write (log_file,'(a)')' ' ! Commented out this call because 7.5-minute raster file is only used ! for plotting purposes @@ -497,6 +509,7 @@ PROGRAM mkCatchParam ! write (log_file,'(a)')'Done creating 7.5 minute raster file ......................' write (log_file,'(a)')'NOTE: 7.5 minute raster file not created (only needed for diagnostic plotting).' write (log_file,'(a)')' Uncomment associated lines in source to generate 7.5 minute raster file.' + write (log_file,'(a)')' ' inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) if (file_exists) then @@ -504,6 +517,7 @@ PROGRAM mkCatchParam call grid2tile_ndep_t2m_alb (nc,nr,gridnamer) write (log_file,'(a)')'Done.' endif + write (log_file,'(a)')' ' inquire(file='clsm/CLM4.5_abm_peatf_gdp_hdm_fc', exist=file_exists) if (.not.file_exists) then @@ -513,7 +527,8 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing CLM4.5_abm_peatf_gdp_hdm_fc file.' endif - + write (log_file,'(a)')' ' + inquire(file='clsm/lnfm.dat', exist=file_exists) if (.not.file_exists) then write (log_file,'(a)')'Creating CLM4.5 lightning frequency file...' @@ -522,7 +537,8 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing CLM4.5 lightning frequency file.' endif - + write (log_file,'(a)')' ' + inquire(file='clsm/country_and_state_code.data', exist=file_exists) if (.not.file_exists) then write (log_file,'(a)')'Mapping country and state codes...' @@ -531,7 +547,8 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using country and state codes file.' endif - + write (log_file,'(a)')' ' + ! inquire(file='clsm/irrig.dat', exist=file_exists) ! if (.not.file_exists) call create_irrig_params (nc,nr,gridnamer) ! write (log_file,'(a)')'Done computing irrigation model parameters ...............13' @@ -541,7 +558,8 @@ PROGRAM mkCatchParam write (log_file,'(a)')'============================================================' write (log_file,'(a)')'DONE creating CLSM data files...............................' write (log_file,'(a)')'============================================================' - + write (log_file,'(a)')' ' + ! call system ('chmod 755 bin/create_README.csh ; bin/create_README.csh') endif From 5fb0cb3ac21e5a86690eeb8e3e3c2fddec826d16 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Wed, 12 Jan 2022 18:33:34 -0500 Subject: [PATCH 11/38] few edits --- .../Utils/Raster/make_bcs | 25 ++++++++----------- .../Utils/Raster/mod_process_hres_data.F90 | 2 +- .../Utils/mk_restarts/mk_GEOSldasRestarts.F90 | 4 +-- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index f1309edfb..5dbf19b8b 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -63,15 +63,11 @@ set BOLD = "\033[1m" set pwd = `pwd` -if( -e $HOME/.make_bcs) then - set make_bcsinfo = `cat $HOME/.make_bcs` - set C1 = $make_bcsinfo[1] - set C2 = $make_bcsinfo[2] -else - set C1 = $RED - set C2 = $BLUE -endif - set CR = $RESET +set C1 = $RED +set C2 = $BLUE +set CR = $RESET + + ####################################################################### # Build Directory Locations ####################################################################### @@ -96,7 +92,7 @@ endif # Create Paths for EXP Directorie ####################################################################### echo -echo "Enter the ${C1}Boundary Conditions Directory Name${CR}:" +echo "Enter the ${C1}EXPERIMENT ID${CR}:" set EXPID = $< # EXP Directory (for Output Data ) @@ -229,8 +225,9 @@ set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') then set lbcsv = $dummy +else if ( $dummy == '' ) then else - echo "You selected lbcsv=$dummy !!!! Invalid Version, stopping !!!! " + echo "You selected lbcsv=$dummy \!\!\!\! Invalid Version, stopping \!\!\!\! " exit endif @@ -337,13 +334,13 @@ else if ( $orslv == O2 | $orslv == O3 | $orslv == CS ) then else - echo " !!!! Invalid Ocean Resolution, stopping !!!! " + echo " \!\!\!\! Invalid Ocean Resolution, stopping \!\!\!\! " exit endif if($HRCODES == m1 | $HRCODES == m3 | $HRCODES == m9 | $HRCODES == m36 | $HRCODES == m25) then - set GLOBAL_CATCH_DATA = ${l_data}/GEOS5_10arcsec_mask_freshwater-lakes.nc + set GLOBAL_CATCH_DATA = ${l_data}/GEOS5_10arcsec_mask.nc endif set MASKFILE = `echo ${GLOBAL_CATCH_DATA} | rev | cut -d / -f1 | rev ` @@ -1262,7 +1259,7 @@ endif /bin/mv clsm clsm.${IM}x${JM} /bin/cp til/SMAP_${EVERSION}_${MGRID}_${RS}.til clsm.${IM}x${JM} -/bin/cp til//${THISGRID}_${THISGRID}-Pfafstetter.TIL clsm.${IM}x${JM} +##/bin/cp til//${THISGRID}_${THISGRID}-Pfafstetter.TIL clsm.${IM}x${JM} cd clsm.${IM}x${JM} /bin/mv irrig.dat irrigation_${RS}_DE.dat diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 index 8b5a6aab9..74e8c80c0 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mod_process_hres_data.F90 @@ -5754,7 +5754,7 @@ SUBROUTINE CLM45_fixed_parameters (nc,nr,gfiler) if(count_pix(i,3) > 0.) abm_int = NINT(abm (i) / count_pix(i,3)) if(count_pix(i,4) > 0.) hdm_r = hdm (i) / count_pix(i,4) - write (10,'(2I8, i3, f8.4, f8.2, f10.2, f8.4)' ) tid, cid, abm_int, peatf_r, gdp_r, hdm_r, field_cap(sc_com) + write (10,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)' ) tid, cid, abm_int, peatf_r, gdp_r, hdm_r, field_cap(sc_com) end do diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_GEOSldasRestarts.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_GEOSldasRestarts.F90 index c14e8cbd6..8c329310b 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_GEOSldasRestarts.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/mk_restarts/mk_GEOSldasRestarts.F90 @@ -1417,7 +1417,7 @@ SUBROUTINE read_bcs_data (ntiles, SURFLAY,MODEL, DataDir, InRestart, rc) if(clm45) then open(unit=30, file=trim(DataDir)//'CLM4.5_abm_peatf_gdp_hdm_fc' ,form='formatted') do n=1,ntiles - read (30,'(2I8, i3, f8.4, f8.2, f10.2, f8.4)' ) i, j, abm(n), peatf(n), & + read (30,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)' ) i, j, abm(n), peatf(n), & gdp(n), hdm(n), fc(n) end do CLOSE (30, STATUS = 'KEEP') @@ -1474,7 +1474,7 @@ SUBROUTINE read_bcs_data (ntiles, SURFLAY,MODEL, DataDir, InRestart, rc) read (29, *) i,j, CLMC45_pt1(n), CLMC45_pt2(n), CLMC45_st1(n), CLMC45_st2(n), & CLMC45_pf1(n), CLMC45_pf2(n), CLMC45_sf1(n), CLMC45_sf2(n) - read (30,'(2I8, i3, f8.4, f8.2, f10.2, f8.4)' ) i, j, abm(n), peatf(n), & + read (30,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)' ) i, j, abm(n), peatf(n), & gdp(n), hdm(n), fc(n) endif endif From bf20ae5cac92bd60b69c8bba2ac6acf57c6cd2b4 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Thu, 13 Jan 2022 11:20:52 -0500 Subject: [PATCH 12/38] minor edits to readme, making formats the same --- .../GEOSsurface_GridComp/Utils/Raster/create_README.csh | 8 +++----- .../GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 6ca2f1566..46e844dda 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -41,7 +41,6 @@ set mygrid=`echo $myusage | cut -d'g' -f2 | cut -d '-' -f1` cvs status src/mkCatchParam.F90 > clsm/TagInfo #echo GMU_OCT10_SM >> clsm/TagInfo echo `head -7 clsm/TagInfo | tail -1` | cut -d':' -f2 | cut -d'(' -f1 > clsm/TagName -set MYTAG=`head -1 clsm/TagName | tail -1` /bin/rm clsm/Tag* # Set Mask/Topo speifics @@ -1056,7 +1055,7 @@ cat << _EOV2_ > clsm/veg2 3.2.3 CLM/CLM4.5, CLM/CLM4.5-carbon, CLM4.5 and CLM4.5-carbon vegetation types and fractions file names: CLM_veg_typs_fracs and CLM4.5_veg_typs_fracs do n = 1, ${NTILES} - read (10,'(2I8,4I3,4f7.2,2I3,2f7.2)') & + read (10,'(2I10,4I3,4f7.2,2I3,2f7.2)') & tile_index,pfaf_code, & CLM-C_pt1,CLM-C_pt2,CLM-C_st1,CLM-C_st2, & CLM-C_pf1,CLM-C_pf2,CLM-C_sf1,CLM-C_sf2, & @@ -1156,7 +1155,7 @@ cat << _EOV2_ > clsm/veg2 population density (HDM) file name: CLM4.5_abm_peatf_gdp_hdm_fc do n = 1, ${NTILES} - read (10,'(2I8, i3, f8.4, f8.2, f10.2, f8.4)') & + read (10,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)') & TID, CID, ABM, PEATF, GDP, HDM, FC end do @@ -1559,7 +1558,7 @@ cat << _EOF2_ > clsm/README3 file name : country_and_state_code.data do n = 1, ${NTILES} - read (10,'(i8, 2I4, 1x, a48, a20)') & + read (10,'(i10, 2I4, 1x, a48, a20)') & tile_index, cnt_code, st_code, CNT_NAME, ST_NAME 8.3 References https://gadm.org @@ -1570,7 +1569,6 @@ cat << _EOF2_ > clsm/README3 APPENDIX I - mkCatchParam tag, input options, and log -CVS TAG : $MYTAG mkCatchParam LOG ~~~~~~~~~~~~~~~~ diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 487f5c431..a6aa0e53f 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -248,7 +248,7 @@ PROGRAM mkCatchParam inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using ESA land cover (MOSAIC/Catch).' + write (log_file,'(a)')'Creating vegetation types using ESA land cover (MOSAIC/Catch)...' call ESA2MOSAIC (nc,nr,gridnamer) write (log_file,'(a)')'Done.' else @@ -258,7 +258,7 @@ PROGRAM mkCatchParam inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM40).' + write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM40)...' call ESA2CLM (nc,nr,gridnamer) write (log_file,'(a)')'Done.' else @@ -268,7 +268,7 @@ PROGRAM mkCatchParam inquire(file='clsm/CLM4.5_veg_typs_fracs', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM45).' + write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM45)...' call ESA2CLM_45 (nc,nr,gridnamer) write (log_file,'(a)')'Done.' else @@ -280,7 +280,7 @@ PROGRAM mkCatchParam inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using IGBP SiB2 land cover (MOSAIC/Catch).' + write (log_file,'(a)')'Creating vegetation types using IGBP SiB2 land cover (MOSAIC/Catch)...' call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) write (log_file,'(a)')'Done.' else From 8260ddbaef279e61706510ca373267d828df0e58 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Thu, 13 Jan 2022 13:00:38 -0500 Subject: [PATCH 13/38] fix for err/log file --- .../Utils/Raster/make_bcs | 22 +++---- .../Utils/Raster/mkCatchParam.F90 | 63 ++++++++++--------- 2 files changed, 45 insertions(+), 40 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 5dbf19b8b..98a3c0e22 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -607,7 +607,7 @@ while ("$group" == "") end -mkdir -p $pwd/logs +mkdir -p $EXPDIR/logs ####################################################################### # LatLon Case @@ -635,8 +635,8 @@ echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME.log -#SBATCH --error=$pwd/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -811,8 +811,8 @@ if ($HRCODE == c2880 | $HRCODE == c3072 | $HRCODE == c5760) then cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME.log -#SBATCH --error=$pwd/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=1 @@ -881,8 +881,8 @@ set make_bcs_jobs = `echo $make_bcs_jobs $BCJOB` cat << _EOF_ > $BCJOB-2 #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME-2.log -#SBATCH --error=$pwd/logs/$BCNAME-2.err +#SBATCH --output=$EXPDIR/logs/$BCNAME-2.log +#SBATCH --error=$EXPDIR/logs/$BCNAME-2.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1012,8 +1012,8 @@ else cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME.log -#SBATCH --error=$pwd/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1208,8 +1208,8 @@ echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME.log -#SBATCH --error=$pwd/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index a6aa0e53f..b5c5e62f4 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -221,11 +221,13 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating catchment.def file...' call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 1' else write (log_file,'(a)')'Using existing catchment.def file.' endif write (log_file,'(a)')' ' + else + write (log_file,'(a)')'Ease grid. Step 1' endif ! Creating cti_stats.dat @@ -235,9 +237,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating CTI stats file...' call cti_stat_file (ease_grid,gridnamet, MaskFile) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 2' else - write (log_file,'(a)')'Using existing CTI stats file.' + write (log_file,'(a)')'Using existing CTI stats file. Step 2' endif write (log_file,'(a)')' ' @@ -250,9 +252,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating vegetation types using ESA land cover (MOSAIC/Catch)...' call ESA2MOSAIC (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 3' else - write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch).' + write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch). Step 3' endif write (log_file,'(a)')' ' @@ -260,9 +262,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM40)...' call ESA2CLM (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 4' else - write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM40).' + write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM40). Step 4' endif write (log_file,'(a)')' ' @@ -270,9 +272,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM45)...' call ESA2CLM_45 (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 5' else - write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM45).' + write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM45). Step 5' endif write (log_file,'(a)')' ' @@ -283,8 +285,9 @@ PROGRAM mkCatchParam write (log_file,'(a)')'Creating vegetation types using IGBP SiB2 land cover (MOSAIC/Catch)...' call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 3-5' else - write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch).' + write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch). Step 3-5' endif write (log_file,'(a)')' ' @@ -311,7 +314,7 @@ PROGRAM mkCatchParam ! creating mapping arrays if necessary - write (log_file,'(a,a)')'Creating vegetation climatologies: ', trim(LAIBCS) + write (log_file,'(a,a)')'Creating vegetation climatologies: ', trim(LAIBCS),'...' if((trim(LAIBCS) == 'MODGEO').or.(trim(LAIBCS) == 'GEOLAND2')) then inquire(file='clsm/lai.GEOLAND2_10-DayClim', exist=file_exists) @@ -396,7 +399,7 @@ PROGRAM mkCatchParam inquire(file='clsm/ndvi.dat', exist=file_exists) if (.not.file_exists) call gimms_clim_ndvi (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 6' write (log_file,'(a)')' ' ! ------------------------------------------------- @@ -407,7 +410,7 @@ PROGRAM mkCatchParam ! MODIS albedo on tile space. The subroutine was replaced with "modis_alb_on_tiles_high" that process ! MODIS1 data on native grid and produces 8/16-day MODIS Albedo climatology - write (log_file,'(a,a)')'Mapping albedo on tile space: ',trim(MODALB) + write (log_file,'(a,a)')'Mapping albedo on tile space: ',trim(MODALB),'...' if(MODALB == 'MODIS1') then inquire(file='clsm/AlbMap.WS.16-day.tile.0.7_5.0.dat', exist=file_exists) @@ -428,7 +431,7 @@ PROGRAM mkCatchParam inquire(file='clsm/AlbMap.WS.8-day.tile.0.7_5.0.dat', exist=file_exists) if (.not.file_exists) call modis_alb_on_tiles_high (43200,21600,maparc30,MODALB,gridnamer) endif - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 7' write (log_file,'(a)')' ' if(.not.F25Tag) then @@ -438,7 +441,7 @@ PROGRAM mkCatchParam ! --------------------------------------------- - write (log_file,'(a)')'Creating albedo scale factors: ',trim(MODALB) + write (log_file,'(a)')'Creating albedo scale factors:',trim(MODALB),'...' inquire(file='clsm/visdf.dat', exist=file_exists) if ((redo_modis).or.(.not.file_exists)) then @@ -454,7 +457,7 @@ PROGRAM mkCatchParam ! endif endif - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 8' write (log_file,'(a)')' ' ! tmpstring1 = '-e EASE -g '//trim(gfile) @@ -479,27 +482,27 @@ PROGRAM mkCatchParam inquire(file='clsm/soil_param.first', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a,a)')'Creating soil parameters: ',trim(SOILBCS) + write (log_file,'(a,a)')'Creating soil parameters:',trim(SOILBCS),'...' if(SOILBCS=='NGDC') then if( F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) if(.not.F25Tag) call soil_para_high (nc,nr,regrid,gridnamer) endif if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 9' else - write (log_file,'(a,a)')'Using existing soil parameter file.' + write (log_file,'(a,a)')'Using existing soil parameter file. Step 9' endif write (log_file,'(a)')' ' inquire(file='clsm/ts.dat', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a,a)')'Creating CLSM model parameters: ',trim(SOILBCS) + write (log_file,'(a,a)')'Creating CLSM model parameters: ',trim(SOILBCS),'...' if(SOILBCS=='NGDC') call create_model_para (MaskFile) if(SOILBCS=='HWSD') call create_model_para_woesten (MaskFile) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 10' else - write (log_file,'(a,a)')'Using existing CLSM model parameter file.' + write (log_file,'(a,a)')'Using existing CLSM model parameter file. Step 10' endif write (log_file,'(a)')' ' @@ -515,7 +518,9 @@ PROGRAM mkCatchParam if (file_exists) then write (log_file,'(a)')'Creating CLSM-CN NDep T2m SoilAlb file...' call grid2tile_ndep_t2m_alb (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 11' + else + write (log_file,'(a)')'Using existing CLSM-CN NDep T2m SoilAlb file. Step 11' endif write (log_file,'(a)')' ' @@ -523,9 +528,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating CLM4.5_abm_peatf_gdp_hdm_fc file...' call CLM45_fixed_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 12' else - write (log_file,'(a)')'Using existing CLM4.5_abm_peatf_gdp_hdm_fc file.' + write (log_file,'(a)')'Using existing CLM4.5_abm_peatf_gdp_hdm_fc file. Step 12' endif write (log_file,'(a)')' ' @@ -533,9 +538,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Creating CLM4.5 lightning frequency file...' call CLM45_clim_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 13' else - write (log_file,'(a)')'Using existing CLM4.5 lightning frequency file.' + write (log_file,'(a)')'Using existing CLM4.5 lightning frequency file. Step 13' endif write (log_file,'(a)')' ' @@ -543,9 +548,9 @@ PROGRAM mkCatchParam if (.not.file_exists) then write (log_file,'(a)')'Mapping country and state codes...' call map_country_codes (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')'Done. Step 14' else - write (log_file,'(a)')'Using country and state codes file.' + write (log_file,'(a)')'Using country and state codes file. Step 14' endif write (log_file,'(a)')' ' From 28d9f1e51cfdbc7786d7e6f51e60f735f74d2279 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Thu, 13 Jan 2022 13:06:45 -0500 Subject: [PATCH 14/38] right commit --- .../GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index b5c5e62f4..8abe042e5 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -314,7 +314,7 @@ PROGRAM mkCatchParam ! creating mapping arrays if necessary - write (log_file,'(a,a)')'Creating vegetation climatologies: ', trim(LAIBCS),'...' + write (log_file,'(a,a)')'Creating vegetation climatologies ... ', trim(LAIBCS) if((trim(LAIBCS) == 'MODGEO').or.(trim(LAIBCS) == 'GEOLAND2')) then inquire(file='clsm/lai.GEOLAND2_10-DayClim', exist=file_exists) @@ -410,7 +410,7 @@ PROGRAM mkCatchParam ! MODIS albedo on tile space. The subroutine was replaced with "modis_alb_on_tiles_high" that process ! MODIS1 data on native grid and produces 8/16-day MODIS Albedo climatology - write (log_file,'(a,a)')'Mapping albedo on tile space: ',trim(MODALB),'...' + write (log_file,'(a,a)')'Mapping albedo on tile space ... ',trim(MODALB) if(MODALB == 'MODIS1') then inquire(file='clsm/AlbMap.WS.16-day.tile.0.7_5.0.dat', exist=file_exists) @@ -441,7 +441,7 @@ PROGRAM mkCatchParam ! --------------------------------------------- - write (log_file,'(a)')'Creating albedo scale factors:',trim(MODALB),'...' + write (log_file,'(a)')'Creating albedo scale factors ... ',trim(MODALB) inquire(file='clsm/visdf.dat', exist=file_exists) if ((redo_modis).or.(.not.file_exists)) then @@ -482,7 +482,7 @@ PROGRAM mkCatchParam inquire(file='clsm/soil_param.first', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a,a)')'Creating soil parameters:',trim(SOILBCS),'...' + write (log_file,'(a,a)')'Creating soil parameters ... ',trim(SOILBCS) if(SOILBCS=='NGDC') then if( F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) if(.not.F25Tag) call soil_para_high (nc,nr,regrid,gridnamer) @@ -497,7 +497,7 @@ PROGRAM mkCatchParam inquire(file='clsm/ts.dat', exist=file_exists) if (.not.file_exists) then - write (log_file,'(a,a)')'Creating CLSM model parameters: ',trim(SOILBCS),'...' + write (log_file,'(a,a)')'Creating CLSM model parameters ... ',trim(SOILBCS) if(SOILBCS=='NGDC') call create_model_para (MaskFile) if(SOILBCS=='HWSD') call create_model_para_woesten (MaskFile) write (log_file,'(a)')'Done. Step 10' From 38a304cce9d34c2844da70045652267ea2dfb21e Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Thu, 13 Jan 2022 13:58:03 -0500 Subject: [PATCH 15/38] add second step to make_bcs --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 98a3c0e22..6a31cc5d1 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -7,7 +7,8 @@ # # ---- USAGE ---- # 1) STEP 1 : build the model. -# 2) STEP 2 : ./make_bcs +# 2) STEP 2 : go to your install/bin +# 3) STEP 3 : ./make_bcs # Answer the following questions: # a) Enter the Atmospheric Horizontal Resolution Code(s) to build: # b) Select the Land BCs version to use: From 269f526078788e9b8b285a326925f067e6ea21c5 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Thu, 13 Jan 2022 14:37:13 -0500 Subject: [PATCH 16/38] cleanup for tag info in readme --- .../GEOSsurface_GridComp/Utils/Raster/create_README.csh | 4 ---- .../GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 46e844dda..8892be0ad 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -38,10 +38,6 @@ set myusage=`head -1 clsm/mkCatchParam.log | tail -1` set NTILES=`head -1 clsm/catchment.def | tail -1` set NGLOBAL=`head -1 til/${gfile}.til | cut -c1-12` set mygrid=`echo $myusage | cut -d'g' -f2 | cut -d '-' -f1` -cvs status src/mkCatchParam.F90 > clsm/TagInfo -#echo GMU_OCT10_SM >> clsm/TagInfo -echo `head -7 clsm/TagInfo | tail -1` | cut -d':' -f2 | cut -d'(' -f1 > clsm/TagName -/bin/rm clsm/Tag* # Set Mask/Topo speifics ######################## diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 8abe042e5..7832f1000 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -225,10 +225,11 @@ PROGRAM mkCatchParam else write (log_file,'(a)')'Using existing catchment.def file.' endif - write (log_file,'(a)')' ' else - write (log_file,'(a)')'Ease grid. Step 1' + write (log_file,'(a)')'Ease grid. ' + write (log_file,'(a)')'Done. Step 1' endif + write (log_file,'(a)')' ' ! Creating cti_stats.dat ! ---------------------- From cfa88ac73253815d825fb1dfbf424b3f153c6dd9 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Thu, 13 Jan 2022 21:16:57 -0500 Subject: [PATCH 17/38] revised USAGE (make_bcs); fixed type (create_README.csh) --- .../Utils/Raster/create_README.csh | 4 ++-- .../Utils/Raster/make_bcs | 20 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 8892be0ad..aedb53fd4 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -39,8 +39,8 @@ set NTILES=`head -1 clsm/catchment.def | tail -1` set NGLOBAL=`head -1 til/${gfile}.til | cut -c1-12` set mygrid=`echo $myusage | cut -d'g' -f2 | cut -d '-' -f1` -# Set Mask/Topo speifics -######################## +# Set Mask/Topo specifics +######################### set MYMASK=`head -6 clsm/mkCatchParam.log | tail -1` set NPfafs=291284 diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 6a31cc5d1..8a866e9cb 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -6,15 +6,17 @@ # specified combination of atmospheric and ocean grid resolutions. # # ---- USAGE ---- -# 1) STEP 1 : build the model. -# 2) STEP 2 : go to your install/bin -# 3) STEP 3 : ./make_bcs -# Answer the following questions: -# a) Enter the Atmospheric Horizontal Resolution Code(s) to build: -# b) Select the Land BCs version to use: -# c) Enter the Ocean Resolution Code(s) to build: -# (Note this selection is not relevant to land-only EASE grids) -# d) Enter sponsor code. +# +# STEP 1 : Build the model (GCM or GEOSldas). +# STEP 2 : cd [install-path]/bin +# STEP 3 : source g5_modules +# STEP 4 : ./make_bcs +# Answer the following interactive questions: +# a) Enter the Atmospheric Horizontal Resolution Code(s) to build. +# b) Select the Land BCs version to use. +# c) Enter the Ocean Resolution Code(s) to build. +# (Note this selection is not relevant to land-only EASE grids) +# d) Enter sponsor code. # ####################################################################### From 5c772388a6abbb63e9404bb8da21fafd2c099ec0 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Thu, 13 Jan 2022 21:59:24 -0500 Subject: [PATCH 18/38] updated path to NLv4 bcs (make_bcs) --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 8a866e9cb..f76118dfd 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -212,7 +212,7 @@ echo " Choose: ${C2}F25 : Fortuna-2_5" echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" echo " ${C2}ICA : Icarus (/discover/nobackup/ltakacs/bcs/Icarus/)" echo " ${C2}NL3 : Icarus-NLv3 (/discover/nobackup/ltakacs/bcs/Icarus-NLv3/)" -echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_temporary/NLv4/)" +echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_NLv4/NLv4/)" echo " ${C2}NL5 : NLv5 [SMAP]" echo " ${C2}DEV : development version" echo " " From d0fc320ba7cf80b2a9cb9527c640be21f3522703 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Thu, 13 Jan 2022 22:00:29 -0500 Subject: [PATCH 19/38] revised/corrected status messages (mkCatchParam.F90) --- .../Utils/Raster/mkCatchParam.F90 | 374 +++++++++++------- 1 file changed, 233 insertions(+), 141 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 7832f1000..0879585f5 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -1,4 +1,4 @@ - PROGRAM mkCatchParam +PROGRAM mkCatchParam ! !INTERFACE: ! @@ -21,41 +21,42 @@ PROGRAM mkCatchParam ! Sarith Mahanama - March 23, 2012 ! Email: sarith.p.mahanama@nasa.gov - use rmTinyCatchParaMod - use process_hres_data - use comp_CATCHCN_AlbScale_parameters, ONLY : albedo4catchcn -! use module_irrig_params, ONLY : create_irrig_params + use rmTinyCatchParaMod + use process_hres_data + use comp_CATCHCN_AlbScale_parameters, ONLY : albedo4catchcn + ! use module_irrig_params, ONLY : create_irrig_params implicit none - integer :: NC = i_raster, NR = j_raster - character*4 :: LBSV = 'DEF' - character*128 :: GridName = '' - character*128 :: ARG, MaskFile - character*256 :: CMD - character*1 :: opt - character*7 :: PEATSOURCE = 'GDLHWSD' - character*3 :: VEGZSOURCE = 'D&S' - character*4 :: EASE =' ' - character*2 :: DL ='DC' - integer :: II, JJ, Type - integer :: I, J, iargc, nxt - real*8 :: dx, dy, lon0 - logical :: regrid - character(len=400), dimension (8) :: Usage - character*128 :: Grid2 - character*2 :: poles - CHARACTER*100 :: gfile,fname,pdir,rstdir - character*128 :: GridNameR = '' - character*128 :: GridNameT = '' - logical :: file_exists - logical :: F25Tag = .false. - logical :: ease_grid=.false., redo_modis=.false. - character*40 :: lai_name - integer, parameter :: log_file = 998 - include 'netcdf.inc' - type (regrid_map) :: maparc30, mapgeoland2,maparc60 - character*200 :: tmpstring, tmpstring1, tmpstring2 - + + include 'netcdf.inc' + + integer :: NC = i_raster, NR = j_raster + character*4 :: LBSV = 'DEF' + character*128 :: GridName = '' + character*128 :: ARG, MaskFile + character*256 :: CMD + character*1 :: opt + character*7 :: PEATSOURCE = 'GDLHWSD' + character*3 :: VEGZSOURCE = 'D&S' + character*4 :: EASE =' ' + character*2 :: DL ='DC' + integer :: II, JJ, Type + integer :: I, J, iargc, nxt + real*8 :: dx, dy, lon0 + logical :: regrid + character(len=400), dimension (8) :: Usage + character*128 :: Grid2 + character*2 :: poles + character*128 :: GridNameR = '' + character*128 :: GridNameT = '' + logical :: file_exists, file_exists2, file_exists3, file_exists4 + logical :: F25Tag = .false. + logical :: ease_grid=.false., redo_modis=.false. + character*40 :: lai_name + integer, parameter :: log_file = 998 + type (regrid_map) :: maparc30, mapgeoland2,maparc60 + character*200 :: tmpstring, tmpstring1, tmpstring2 + character*200 :: fname_tmp, fname_tmp2, fname_tmp3, fname_tmp4 ! --------- VARIABLES FOR *OPENMP* PARALLEL ENVIRONMENT ------------ ! @@ -207,7 +208,7 @@ PROGRAM mkCatchParam if(index(Gridname,'CF')/=0) then DL = 'DE' - write (log_file,'(a)')'Cube Grid - assuming DE' + write (log_file,'(a)')'Cube-Sphere Grid - assuming dateline-on-edge (DE)' endif inquire(file='clsm/catch_params.nc4', exist=file_exists) @@ -216,31 +217,36 @@ PROGRAM mkCatchParam ! Creating catchment.def ! ---------------------- + tmpstring = 'Step 01: Supplemental catchment definitions' + fname_tmp = 'clsm/catchment.def' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' if(.not.ease_grid) then - inquire(file='clsm/catchment.def', exist=file_exists) + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating catchment.def file...' + write (log_file,'(a)')'Creating file...' call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) - write (log_file,'(a)')'Done. Step 1' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing catchment.def file.' + write (log_file,'(a)')'Using existing file.' endif else - write (log_file,'(a)')'Ease grid. ' - write (log_file,'(a)')'Done. Step 1' + write (log_file,'(a)')'Skipping step for EASE grid. ' endif write (log_file,'(a)')' ' ! Creating cti_stats.dat ! ---------------------- - - inquire(file='clsm/cti_stats.dat', exist=file_exists) + + tmpstring = 'Step 02: Compound Topographic Index (CTI) stats' + fname_tmp = 'clsm/cti_stats.dat' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating CTI stats file...' + write (log_file,'(a)')'Creating file...' call cti_stat_file (ease_grid,gridnamet, MaskFile) - write (log_file,'(a)')'Done. Step 2' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing CTI stats file. Step 2' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' @@ -248,47 +254,58 @@ PROGRAM mkCatchParam !----------------------------------------- if (index(MaskFile,'GEOS5_10arcsec_mask') /= 0) then - - inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) + + tmpstring = 'Step 03: Vegetation types using ESA land cover (MOSAIC/Catch)' + fname_tmp = 'clsm/mosaic_veg_typs_fracs' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using ESA land cover (MOSAIC/Catch)...' + write (log_file,'(a)')'Creating file...' call ESA2MOSAIC (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 3' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch). Step 3' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' - - inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) + + tmpstring = 'Step 04: Vegetation types using ESA land cover (CatchCNCLM40)' + fname_tmp = 'clsm/CLM_veg_typs_fracs' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM40)...' + write (log_file,'(a)')'Creating file...' call ESA2CLM (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 4' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM40). Step 4' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' - inquire(file='clsm/CLM4.5_veg_typs_fracs', exist=file_exists) + tmpstring = 'Step 05: Vegetation types using ESA land cover (CatchCNCLM45)' + fname_tmp = 'clsm/CLM4.5_veg_typs_fracs' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using ESA land cover (CatchCNCLM45)...' + write (log_file,'(a)')'Creating file...' call ESA2CLM_45 (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 5' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing vegetation types file (CatchCNCLM45). Step 5' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' else - inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) + tmpstring = 'Step 03: Vegetation types using IGBP SiB2 land cover (MOSAIC/Catch)' + fname_tmp = 'clsm/mosaic_veg_typs_fracs' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating vegetation types using IGBP SiB2 land cover (MOSAIC/Catch)...' + write (log_file,'(a)')'Creating file...' call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) write (log_file,'(a)')'Done.' - write (log_file,'(a)')'Done. Step 3-5' else - write (log_file,'(a)')'Using existing vegetation types file (MOSAIC/Catch). Step 3-5' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' @@ -306,6 +323,7 @@ PROGRAM mkCatchParam write (log_file,'(a)')'NOTE: The selected mask works only for the Catchment model.' write (log_file,'(a)')' Vegetation types *not* created for CatchCNCLM[xx].' + write (log_file,'(a)')' SKIPPING Step 04 and Step 05 !!!' write (log_file,'(a)')' ' endif @@ -314,12 +332,16 @@ PROGRAM mkCatchParam ! --------------------------------- ! creating mapping arrays if necessary - - write (log_file,'(a,a)')'Creating vegetation climatologies ... ', trim(LAIBCS) + + tmpstring = 'Step 06: Vegetation climatologies' + write (log_file,'(a,a,a)') trim(tmpstring),' ', trim(LAIBCS) if((trim(LAIBCS) == 'MODGEO').or.(trim(LAIBCS) == 'GEOLAND2')) then - inquire(file='clsm/lai.GEOLAND2_10-DayClim', exist=file_exists) + fname_tmp = 'clsm/lai.GEOLAND2_10-DayClim' + write (log_file,'(a,a)')' --> ', trim(fname_tmp) + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then + write (log_file,'(a)')'Creating file...' !allocate (mapgeoland2 (1:40320,1:20160)) call create_mapping (nc,nr,40320,20160,mapgeoland2, gridnamer) lai_name = 'GEOLAND2_10-DayClim/geoland2_' @@ -331,6 +353,9 @@ PROGRAM mkCatchParam ! if(allocated(mapgeoland2)) deallocate (mapgeoland2) deallocate (mapgeoland2%map) deallocate (mapgeoland2%ij_index) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing file.' endif endif @@ -339,9 +364,11 @@ PROGRAM mkCatchParam call create_mapping (nc,nr,43200,21600,maparc30, gridnamer) endif - inquire(file='clsm/green.dat', exist=file_exists) - + fname_tmp = 'clsm/green.dat' + write (log_file,'(a,a)')' --> ', trim(fname_tmp) + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then + write (log_file,'(a)')'Creating file...' if (trim(LAIBCS) == 'GSWP2') then call process_gswp2_veg (nc,nr,regrid,'grnFrac',gridnamer) else @@ -351,11 +378,16 @@ PROGRAM mkCatchParam endif call hres_gswp2 (43200,21600, maparc30, gridnamer,'green') endif + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing file.' endif - - inquire(file='clsm/lai.dat', exist=file_exists) - + + fname_tmp = 'clsm/lai.dat' + write (log_file,'(a,a)')' --> ', trim(fname_tmp) + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then + write (log_file,'(a)')'Creating file...' redo_modis = .true. if (trim(LAIBCS) == 'GSWP2') call process_gswp2_veg (nc,nr,regrid,'LAI',gridnamer) @@ -394,13 +426,23 @@ PROGRAM mkCatchParam lai_name = 'GLASS-LAI/MODIS.v4/GLASS01B01.V04.AYYYY' call grid2tile_glass (nc,nr,gridnamer,lai_name) endif - + + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing file.' endif - inquire(file='clsm/ndvi.dat', exist=file_exists) - if (.not.file_exists) call gimms_clim_ndvi (nc,nr,gridnamer) + fname_tmp = 'clsm/ndvi.dat' + write (log_file,'(a,a)')' --> ', trim(fname_tmp) + inquire(file=trim(fname_tmp), exist=file_exists) + if (.not.file_exists) then + write (log_file,'(a)')'Creating file...' + call gimms_clim_ndvi (nc,nr,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing file.' + endif - write (log_file,'(a)')'Done. Step 6' write (log_file,'(a)')' ' ! ------------------------------------------------- @@ -410,29 +452,44 @@ PROGRAM mkCatchParam ! NOTE: modis_alb_on_tiles uses monthly climatological raster data on 8640x4320 to produce ! MODIS albedo on tile space. The subroutine was replaced with "modis_alb_on_tiles_high" that process ! MODIS1 data on native grid and produces 8/16-day MODIS Albedo climatology - - write (log_file,'(a,a)')'Mapping albedo on tile space ... ',trim(MODALB) + + + tmpstring = 'Step 07: Albedo climatologies' + write (log_file,'(a,a,a)') trim(tmpstring),' ', trim(MODALB) if(MODALB == 'MODIS1') then - inquire(file='clsm/AlbMap.WS.16-day.tile.0.7_5.0.dat', exist=file_exists) + fname_tmp = 'clsm/AlbMap.WS.16-day.tile.0.7_5.0.dat' + write (log_file,'(a,a)')' --> ', trim(fname_tmp) + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then + write (log_file,'(a)')'Creating file...' if(F25Tag) then call create_mapping (nc,nr,21600,10800,maparc60, gridnamer) call modis_alb_on_tiles_high (21600,10800,maparc60,MODALB,gridnamer) deallocate (maparc60%map) deallocate (maparc60%ij_index) else - ! This option is for legacy sets like Fortuna 2.1 + ! This option is for legacy sets like Fortuna 2.1 call modis_alb_on_tiles (nc,nr,ease_grid,regrid,gridnamet,gridnamer) endif + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing file.' endif endif if(MODALB == 'MODIS2') then - inquire(file='clsm/AlbMap.WS.8-day.tile.0.7_5.0.dat', exist=file_exists) - if (.not.file_exists) call modis_alb_on_tiles_high (43200,21600,maparc30,MODALB,gridnamer) + fname_tmp = 'clsm/AlbMap.WS.8-day.tile.0.7_5.0.dat' + write (log_file,'(a,a)')' --> ', trim(fname_tmp) + inquire(file=trim(fname_tmp), exist=file_exists) + if (.not.file_exists) then + write (log_file,'(a)')'Creating file...' + call modis_alb_on_tiles_high (43200,21600,maparc30,MODALB,gridnamer) + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing file.' + endif endif - write (log_file,'(a)')'Done. Step 7' write (log_file,'(a)')' ' if(.not.F25Tag) then @@ -442,36 +499,46 @@ PROGRAM mkCatchParam ! --------------------------------------------- - write (log_file,'(a)')'Creating albedo scale factors ... ',trim(MODALB) - - inquire(file='clsm/visdf.dat', exist=file_exists) - if ((redo_modis).or.(.not.file_exists)) then - ! if(.not.F25Tag) then - call modis_scale_para_high (ease_grid,MODALB,gridnamet) - ! else - ! This option is for legacy sets like Fortuna 2.1 - ! inquire(file='clsm/modis_scale_factor.albvf.clim', exist=file_exists) - ! if ((redo_modis).or.(.not.file_exists)) then - ! call modis_scale_para (ease_grid,gridnamet) - ! call REFORMAT_VEGFILES - ! endif - ! endif + tmpstring = 'Step 08: Albedo scale factors' + write (log_file,'(a,a,a)') trim(tmpstring),' ', trim(MODALB) + + ! NOTE: There are two files with albedo scale factors: "visdf.dat" and "nirdf.dat". + ! Added check for "nirdf.dat", which was missing before. - reichle, 13 Jan 2022 + + fname_tmp = 'clsm/visdf.dat' + fname_tmp2 = 'clsm/nirdf.dat' + write (log_file,'(a,a,a,a)')' --> ', trim(fname_tmp), ', ', trim(fname_tmp2) + inquire(file=trim(fname_tmp ), exist=file_exists ) + inquire(file=trim(fname_tmp2), exist=file_exists2) + if ((redo_modis).or.(.not.file_exists).or.(.not.file_exists2)) then + ! if(.not.F25Tag) then + write (log_file,'(a)')'Creating files...' + call modis_scale_para_high (ease_grid,MODALB,gridnamet) + ! else + ! This option is for legacy sets like Fortuna 2.1 + ! inquire(file='clsm/modis_scale_factor.albvf.clim', exist=file_exists) + ! if ((redo_modis).or.(.not.file_exists)) then + ! call modis_scale_para (ease_grid,gridnamet) + ! call REFORMAT_VEGFILES + ! endif + ! endif + write (log_file,'(a)')'Done.' + else + write (log_file,'(a)')'Using existing files.' endif - - write (log_file,'(a)')'Done. Step 8' write (log_file,'(a)')' ' -! tmpstring1 = '-e EASE -g '//trim(gfile) -! write(tmpstring2,'(2(a2,x,i5,x))')'-x',nc,'-y',nr -! tmpstring = 'bin/mkCatchParam_openmp '//trim(tmpstring2)//' '//trim(tmpstring1) - + ! tmpstring1 = '-e EASE -g '//trim(gfile) + ! write(tmpstring2,'(2(a2,x,i5,x))')'-x',nc,'-y',nr + ! tmpstring = 'bin/mkCatchParam_openmp '//trim(tmpstring2)//' '//trim(tmpstring1) + else - + ! this block is for n_threads>1 !============================== if(SOILBCS=='NGDC') then - write (log_file,'(a)')'Creating NGDC soil types file...' + write (log_file,'(a)')'Creating (intermediate) NGDC soil types file...' call create_soil_types_files (nc,nr,ease_grid,gridnamet,gridnamer) write (log_file,'(a)')'Done.' write (log_file,'(a)')' ' @@ -481,32 +548,44 @@ PROGRAM mkCatchParam ! 1) NGDC soil properties, 2) HWSD-STATSGO2 Soil Properties ! --------------------------------------------------------------------- - inquire(file='clsm/soil_param.first', exist=file_exists) + tmpstring = 'Step 09: Soil parameters ' // trim(SOILBCS) + fname_tmp = 'clsm/soil_param.first' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a,a)')'Creating soil parameters ... ',trim(SOILBCS) + write (log_file,'(a)')'Creating file...' if(SOILBCS=='NGDC') then if( F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) if(.not.F25Tag) call soil_para_high (nc,nr,regrid,gridnamer) - endif + endif if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 9' + write (log_file,'(a)')'Done.' else - write (log_file,'(a,a)')'Using existing soil parameter file. Step 9' + write (log_file,'(a,a)')'Using existing file.' endif write (log_file,'(a)')' ' - - inquire(file='clsm/ts.dat', exist=file_exists) - if (.not.file_exists) then - write (log_file,'(a,a)')'Creating CLSM model parameters ... ',trim(SOILBCS) + tmpstring = 'Step 10: CLSM model parameters ' // trim(SOILBCS) + fname_tmp = 'clsm/ar.new' + fname_tmp2 = 'clsm/bf.dat' + fname_tmp3 = 'clsm/ts.dat' + fname_tmp4 = 'clsm/soil_param.dat' + tmpstring1 = trim(fname_tmp) // ', ' // trim(fname_tmp2) // ', ' // trim(fname_tmp3) // ', ' // trim(fname_tmp4) + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(tmpstring1), ')' + inquire(file=trim(fname_tmp ), exist=file_exists ) + inquire(file=trim(fname_tmp2), exist=file_exists2) + inquire(file=trim(fname_tmp3), exist=file_exists3) + inquire(file=trim(fname_tmp4), exist=file_exists4) + if ((.not.file_exists).or.(.not.file_exists2).or.(.not.file_exists3).or.(.not.file_exists4)) then + write (log_file,'(a)')'Creating files...' if(SOILBCS=='NGDC') call create_model_para (MaskFile) if(SOILBCS=='HWSD') call create_model_para_woesten (MaskFile) - write (log_file,'(a)')'Done. Step 10' + write (log_file,'(a)')'Done.' else - write (log_file,'(a,a)')'Using existing CLSM model parameter file. Step 10' + write (log_file,'(a,a)')'Using existing files.' endif write (log_file,'(a)')' ' - + ! Commented out this call because 7.5-minute raster file is only used ! for plotting purposes ! call make_75 (nc,nr,regrid,c_data,gridnamer) @@ -515,58 +594,71 @@ PROGRAM mkCatchParam write (log_file,'(a)')' Uncomment associated lines in source to generate 7.5 minute raster file.' write (log_file,'(a)')' ' + tmpstring = 'Step 11: CatchCNCLM40 NDep T2m SoilAlb parameters' + fname_tmp = 'clsm/CLM_NDep_SoilAlb_T2m' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + ! create this file only if matching veg types file already exists inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) if (file_exists) then - write (log_file,'(a)')'Creating CLSM-CN NDep T2m SoilAlb file...' + write (log_file,'(a)')'Creating file...' call grid2tile_ndep_t2m_alb (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 11' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing CLSM-CN NDep T2m SoilAlb file. Step 11' + write (log_file,'(a)')'Skipping step for lack of matching veg types file.' endif write (log_file,'(a)')' ' - - inquire(file='clsm/CLM4.5_abm_peatf_gdp_hdm_fc', exist=file_exists) + + tmpstring = 'Step 12: CatchCNCLM45 abm peatf gdp hdm fc parameters' + fname_tmp = 'clsm/CLM4.5_abm_peatf_gdp_hdm_fc' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating CLM4.5_abm_peatf_gdp_hdm_fc file...' + write (log_file,'(a)')'Creating file...' call CLM45_fixed_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 12' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing CLM4.5_abm_peatf_gdp_hdm_fc file. Step 12' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' - inquire(file='clsm/lnfm.dat', exist=file_exists) + tmpstring = 'Step 13: CatchCNCLM45 lightning frequency' + fname_tmp = 'clsm/lnfm.dat' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating CLM4.5 lightning frequency file...' + write (log_file,'(a)')'Creating file...' call CLM45_clim_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 13' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using existing CLM4.5 lightning frequency file. Step 13' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' - - inquire(file='clsm/country_and_state_code.data', exist=file_exists) + + tmpstring = 'Step 14: Country and state codes' + fname_tmp = 'clsm/country_and_state_code.data' + write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' + inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Mapping country and state codes...' + write (log_file,'(a)')'Creating file...' call map_country_codes (nc,nr,gridnamer) - write (log_file,'(a)')'Done. Step 14' + write (log_file,'(a)')'Done.' else - write (log_file,'(a)')'Using country and state codes file. Step 14' + write (log_file,'(a)')'Using existing file.' endif write (log_file,'(a)')' ' - ! inquire(file='clsm/irrig.dat', exist=file_exists) - ! if (.not.file_exists) call create_irrig_params (nc,nr,gridnamer) - ! write (log_file,'(a)')'Done computing irrigation model parameters ...............13' - - ! call albedo4catchcn (gridnamet) - + ! inquire(file='clsm/irrig.dat', exist=file_exists) + ! if (.not.file_exists) call create_irrig_params (nc,nr,gridnamer) + ! write (log_file,'(a)')'Done computing irrigation model parameters ...............13' + + ! call albedo4catchcn (gridnamet) + write (log_file,'(a)')'============================================================' write (log_file,'(a)')'DONE creating CLSM data files...............................' write (log_file,'(a)')'============================================================' write (log_file,'(a)')' ' -! call system ('chmod 755 bin/create_README.csh ; bin/create_README.csh') + ! call system ('chmod 755 bin/create_README.csh ; bin/create_README.csh') endif close (log_file,status='keep') From 9fff9eb3012805b58a0d8c4cc8dfeec7624a2df9 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Mon, 17 Jan 2022 11:07:35 -0500 Subject: [PATCH 20/38] cleanup of code options --- .../Utils/Raster/make_bcs | 150 +++++++++--------- 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index f76118dfd..f91ea85c5 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -9,8 +9,7 @@ # # STEP 1 : Build the model (GCM or GEOSldas). # STEP 2 : cd [install-path]/bin -# STEP 3 : source g5_modules -# STEP 4 : ./make_bcs +# STEP 3 : ./make_bcs # Answer the following interactive questions: # a) Enter the Atmospheric Horizontal Resolution Code(s) to build. # b) Select the Land BCs version to use. @@ -22,6 +21,9 @@ # process input arguments +# When "noland" argument is used the script stops after deriving surface tile files. +# ./make_bcs noland + set SKIPLAND = NO if ( $1 == noland ) set SKIPLAND = YES @@ -71,71 +73,36 @@ set C2 = $BLUE set CR = $RESET -####################################################################### -# Build Directory Locations -####################################################################### - -# Set Current Working Path to make_bcs -# ------------------------------------- -setenv ARCH `uname -s` -if ($ARCH == Darwin) then - set FINDPATH = realpath -else - set FINDPATH = 'readlink -f' -endif -set MAKE_BCS = `$FINDPATH $0` - -# Test if GEOSgcm.x or GEOSldas.x are here which means you are in install directory -if (! -x GEOSgcm.x && ! -x GEOSldas.x) then - echo "You are trying to run $0 from the wrong directory" - echo "Please run from the bin/ directory in your installation" - exit 1 -endif ####################################################################### # Create Paths for EXP Directorie ####################################################################### -echo -echo "Enter the ${C1}EXPERIMENT ID${CR}:" -set EXPID = $< # EXP Directory (for Output Data ) # -------------------------------------------- - set check = FALSE -while( $check == FALSE ) - if( -e $HOME/.EXPDIRroot ) then - set EXPDIRroot = `cat $HOME/.EXPDIRroot` - else - set EXPDIRroot = $WRKDIR - endif - setenv EXPDIR_def $EXPDIRroot/$EXPID + setenv EXPDIR /discover/nobackup/$USER/BC_PACKAGE + echo "" echo "Enter Desired Location for the ${C1}EXPERIMENT${CR} Directory (to contain BC's output)" echo "Hit ENTER to use Default Location:" echo "----------------------------------" - echo "Default: ${C2}${EXPDIR_def}${CR}" - set NUEXPDIR = $< - if( .$NUEXPDIR != . ) then - setenv EXPDIR $NUEXPDIR - setenv EXPDIR_def $NUEXPDIR - else - setenv EXPDIR $EXPDIR_def - endif - - if( "$EXPID" != `basename $EXPDIR` ) then - echo "\!\! The ${C1}EXPERIMENT${CR} Directory MUST point to the ${C1}EXPID${CR}: ${C2}${EXPID}${CR}" - echo " " - else - set check = TRUE - endif -end -mkdir -p $EXPDIR - + echo "Default: ${C2}${EXPDIR}${CR}" + set NEWEXPDIR = $< + if( $NEWEXPDIR == '' ) then + mkdir -p $EXPDIR + if($EXPDIR == '') then + else + echo "${C1}\!\!\!\! NOTE: Choosen directory not empty. \!\!\!\!${CR} " + echo "${C1}\!\!\!\! Same resolution BC's will be overwritten. \!\!\!\!${CR} " + endif + else + mkdir -p $NEWEXPDIR + setenv EXPDIR $NEWEXPDIR + endif ####################################################################### # # Atmospheric Horizontal Resolution (HRCODE) -HRCODE: echo " " echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR} to be built:" echo "------------------------------------------------------------------------------------------------------------------" @@ -159,6 +126,7 @@ echo " ${C2} c5760 -- 1/64 deg (${C1}1.5-km${C2}) ${C echo " " #echo " ${C2}o -- other${CR} Lat/Lon or Cube" echo " " +HRCODE: set dummy = `echo $<` set dummy = `echo $dummy | tr "[:upper:]" "[:lower:]"` set HRCODES = $dummy[1] @@ -188,7 +156,11 @@ foreach HRCODE ($dummy) $HRCODE != 'm3' & \ $HRCODE != 'm9' & \ $HRCODE != 'm36' & \ - $HRCODE != 'm25') goto HRCODE + $HRCODE != 'm25') then + echo " " + echo " ${C1} Wrong choice, try again:${CR}" + goto HRCODE + endif if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` end @@ -203,10 +175,10 @@ endif # Land bcs version (LBCSV) # set default land bcs version -set lbcsv = NL3 +set lbcsv = NL3 LBCSV: -echo +echo " " echo "Enter 3-character alphanumeric code to select specific ${C1}Land BCs version ${CR} to use:" echo " Choose: ${C2}F25 : Fortuna-2_5" echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" @@ -223,7 +195,8 @@ echo " Nevertheless, the impact of these differences on scien echo " the parameter files produced by current source code is considered to be" echo " scientifically equivalent to the corresponding archived BCs" echo " " -echo " OR press ENTER to select $lbcsv (current default)." +echo " OR press ENTER to select $lbcsv (current default).${CR}" +echo " " set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') then @@ -231,23 +204,28 @@ if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | else if ( $dummy == '' ) then else echo "You selected lbcsv=$dummy \!\!\!\! Invalid Version, stopping \!\!\!\! " - exit + exit endif ####################################################################### -if($HRCODES == m1 | $HRCODES == m3 | $HRCODES == m9 | $HRCODES == m36 | $HRCODES == m25) then +if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m25) then set orslvs = O1 + echo " " + echo " ${C2}------------------------------------------------------------------------------" + echo " ${C1}NOTE: With selection of EASE grid Ocean resolution is set to $orslvs ${CR}" + echo " ${C1} O1 -- Low-Resolution Reynolds 1deg (Lon/Lat Data-Ocean: 360x180) ${CR}" + echo " ${C2}------------------------------------------------------------------------------" + echo " " else ####################################################################### # # Ocean Horizontal Resolution (ORSLV) -ORSLV: - echo + echo " " echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR} to be built:" echo " Choose: ${C2}O1 -- Low-Resolution Reynolds 1 deg${CR} (Lon/Lat Data-Ocean: 360x180) " echo " ${C2}O2 -- Med-Resolution Reynolds 1/4 deg${CR} (Lon/Lat Data-Ocean: 1440x720) " @@ -259,7 +237,8 @@ ORSLV: # echo " ${C2}T2MOM6 -- Med-Resolution Tripolar 1 deg${CR} (MOM6-Tripolar-Ocean: 360x210) " echo " ${C2}T4MOM6 -- High-Resolution Tripolar 1/4 deg${CR} (MOM6-Tripolar-Ocean: 1440x1080) " echo " ${C2}CS -- Cubed-Sphere Ocean ${CR} (Cubed-Sphere Data-Ocean ) " - echo " (Select anything just to move forward for land-only EASE grids.)" + echo " " +ORSLV: set dummy = `echo $<` set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` set orslvs = $dummy[1] @@ -273,7 +252,12 @@ ORSLV: $orslv != 'T1MOM6' & \ $orslv != 'T2MOM6' & \ $orslv != 'T4MOM6' & \ - $orslv != 'CS') goto ORSLV + $orslv != 'CS') then + echo " " + echo " ${C1} Wrong choice, try again:${CR}" + goto ORSLV + endif + if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` end @@ -342,7 +326,7 @@ else endif -if($HRCODES == m1 | $HRCODES == m3 | $HRCODES == m9 | $HRCODES == m36 | $HRCODES == m25) then +if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m25) then set GLOBAL_CATCH_DATA = ${l_data}/GEOS5_10arcsec_mask.nc endif @@ -610,7 +594,6 @@ while ("$group" == "") end -mkdir -p $EXPDIR/logs ####################################################################### # LatLon Case @@ -625,21 +608,26 @@ set IM = `echo ${im} | awk '{printf "%4.4i", $1}'` set JM = `echo ${jm} | awk '{printf "%4.4i", $1}'` set IMO = `echo ${imo} | awk '{printf "%4.4i", $1}'` set JMO = `echo ${jmo} | awk '{printf "%4.4i", $1}'` +set NC = `echo ${nc} | awk '{printf "%4.4i", $1}'` + +set DATENAME = DE +set POLENAME = PE set BCNAME = DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO} set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j if( -e $BCDIR) /bin/rm -r $BCDIR -mkdir -p $BCDIR +mkdir -p $BCDIR +mkdir -p $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -770,6 +758,8 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR #mkdir -p IRRIG/$BCNAME/clsm @@ -807,6 +797,7 @@ set BCJOB = $BCDIR/$BCNAME.j if( -e $BCDIR) /bin/rm -r $BCDIR mkdir -p $BCDIR +mkdir -p $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -814,8 +805,8 @@ if ($HRCODE == c2880 | $HRCODE == c3072 | $HRCODE == c5760) then cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=1 @@ -884,8 +875,8 @@ set make_bcs_jobs = `echo $make_bcs_jobs $BCJOB` cat << _EOF_ > $BCJOB-2 #!/bin/csh -x -#SBATCH --output=$EXPDIR/logs/$BCNAME-2.log -#SBATCH --error=$EXPDIR/logs/$BCNAME-2.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME-2.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME-2.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1002,6 +993,8 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB-2 $BCNAME +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR #mkdir -p IRRIG/$BCNAME/clsm @@ -1015,8 +1008,8 @@ else cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1169,6 +1162,8 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR #mkdir -p IRRIG/$BCNAME/clsm @@ -1203,7 +1198,8 @@ set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j set THISGRID = SMAP-${EVERSION}-${MGRID} if( -e $BCDIR) /bin/rm -r $BCDIR -mkdir -p $BCDIR +mkdir -p $BCDIR +mkdir -p $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -1211,8 +1207,8 @@ echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1324,6 +1320,8 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR #mkdir -p IRRIG/$BCNAME/clsm IRRIG/$BCNAME/rst From c1875688a0c5d5badf8397f5d4b42b962fc300ee Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Tue, 18 Jan 2022 17:50:29 -0500 Subject: [PATCH 21/38] Add'l cleanup of comments and messages in make_bcs; prettier indent of status messages in mkCatchParam.F90 --- .../Utils/Raster/make_bcs | 68 +++++------ .../Utils/Raster/mkCatchParam.F90 | 114 +++++++++--------- .../Utils/Raster/rmTinyCatchParaMod.F90 | 3 +- 3 files changed, 93 insertions(+), 92 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index f91ea85c5..885f80db4 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -7,23 +7,27 @@ # # ---- USAGE ---- # -# STEP 1 : Build the model (GCM or GEOSldas). -# STEP 2 : cd [install-path]/bin -# STEP 3 : ./make_bcs -# Answer the following interactive questions: -# a) Enter the Atmospheric Horizontal Resolution Code(s) to build. -# b) Select the Land BCs version to use. -# c) Enter the Ocean Resolution Code(s) to build. -# (Note this selection is not relevant to land-only EASE grids) -# d) Enter sponsor code. +# STEP 1: Build the model (GCM or GEOSldas). +# STEP 2: cd [install-path]/bin +# STEP 3: ./make_bcs +# Answer the following interactive questions: +# a) Enter Atmospheric Horizontal Resolution Code(s) to build. +# b) Select Land BCs version to use. +# c) Enter Ocean Resolution Code(s) to build. +# (Selection not relevant for land-only EASE grids.) +# d) Enter sponsor code. # +# To skip the generation of land parameter files (i.e., mkCatchParam.x), +# use: ./make_bcs noland +# This option can potentially save time when additional bcs are created +# that have the exact same land parameters as an existing set of bcs +# because the only difference between the two sets of bcs is the +# [non-tripolar] ocean resolution. +# ####################################################################### # process input arguments -# When "noland" argument is used the script stops after deriving surface tile files. -# ./make_bcs noland - set SKIPLAND = NO if ( $1 == noland ) set SKIPLAND = YES @@ -79,20 +83,19 @@ set CR = $RESET # EXP Directory (for Output Data ) # -------------------------------------------- - setenv EXPDIR /discover/nobackup/$USER/BC_PACKAGE + setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE echo "" - echo "Enter Desired Location for the ${C1}EXPERIMENT${CR} Directory (to contain BC's output)" - echo "Hit ENTER to use Default Location:" - echo "----------------------------------" - echo "Default: ${C2}${EXPDIR}${CR}" + echo "Enter desired ${C1}output directory${CR} (incl. full path)" + echo " or press ENTER to use the default:" + echo " [${C2}${EXPDIR}${CR}]" set NEWEXPDIR = $< if( $NEWEXPDIR == '' ) then mkdir -p $EXPDIR if($EXPDIR == '') then else - echo "${C1}\!\!\!\! NOTE: Choosen directory not empty. \!\!\!\!${CR} " - echo "${C1}\!\!\!\! Same resolution BC's will be overwritten. \!\!\!\!${CR} " + echo "${C1}\!\!\!\! NOTE: Chosen directory not empty. \!\!\!\!${CR} " + echo "${C1}\!\!\!\! Same resolution BCS will be overwritten. \!\!\!\!${CR} " endif else mkdir -p $NEWEXPDIR @@ -104,7 +107,7 @@ set CR = $RESET # Atmospheric Horizontal Resolution (HRCODE) echo " " -echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR} to be built:" +echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR}to be built:" echo "------------------------------------------------------------------------------------------------------------------" echo " Lat/Lon Cubed-Sphere EASE (land-only)" echo "------------------------------------------------------------------------------------------------------------------" @@ -158,7 +161,7 @@ foreach HRCODE ($dummy) $HRCODE != 'm36' & \ $HRCODE != 'm25') then echo " " - echo " ${C1} Wrong choice, try again:${CR}" + echo " ${C1} Invalid choice, try again:${CR}" goto HRCODE endif if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` @@ -207,26 +210,23 @@ else exit endif -####################################################################### +####################################################################### +# +# Ocean Horizontal Resolution (ORSLV) + if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m25) then set orslvs = O1 echo " " - echo " ${C2}------------------------------------------------------------------------------" - echo " ${C1}NOTE: With selection of EASE grid Ocean resolution is set to $orslvs ${CR}" - echo " ${C1} O1 -- Low-Resolution Reynolds 1deg (Lon/Lat Data-Ocean: 360x180) ${CR}" - echo " ${C2}------------------------------------------------------------------------------" + echo " $------------------------------------------------------------------------------" + echo " ${C1}NOTE: With selection of EASE grid for the Atmospheric Horizontal Resolution${CR}," + echo " ${C1} the Ocean resolution is irrelevant and set to $orslvs ${CR}" + echo " $------------------------------------------------------------------------------" echo " " else - -####################################################################### -# -# Ocean Horizontal Resolution (ORSLV) - - echo " " - echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR} to be built:" + echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR}to be built:" echo " Choose: ${C2}O1 -- Low-Resolution Reynolds 1 deg${CR} (Lon/Lat Data-Ocean: 360x180) " echo " ${C2}O2 -- Med-Resolution Reynolds 1/4 deg${CR} (Lon/Lat Data-Ocean: 1440x720) " echo " ${C2}O3 -- High-Resolution OSTIA 1/8 deg${CR} (Lon/Lat Data-Ocean: 2880x1440) " @@ -254,7 +254,7 @@ ORSLV: $orslv != 'T4MOM6' & \ $orslv != 'CS') then echo " " - echo " ${C1} Wrong choice, try again:${CR}" + echo " ${C1} Invalid choice, try again:${CR}" goto ORSLV endif if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 index 0879585f5..2675f127d 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/mkCatchParam.F90 @@ -223,11 +223,11 @@ PROGRAM mkCatchParam if(.not.ease_grid) then inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif else write (log_file,'(a)')'Skipping step for EASE grid. ' @@ -242,11 +242,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call cti_stat_file (ease_grid,gridnamet, MaskFile) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -260,11 +260,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call ESA2MOSAIC (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -273,11 +273,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call ESA2CLM (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -286,11 +286,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call ESA2CLM_45 (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -301,11 +301,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -341,7 +341,7 @@ PROGRAM mkCatchParam write (log_file,'(a,a)')' --> ', trim(fname_tmp) inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' !allocate (mapgeoland2 (1:40320,1:20160)) call create_mapping (nc,nr,40320,20160,mapgeoland2, gridnamer) lai_name = 'GEOLAND2_10-DayClim/geoland2_' @@ -353,9 +353,9 @@ PROGRAM mkCatchParam ! if(allocated(mapgeoland2)) deallocate (mapgeoland2) deallocate (mapgeoland2%map) deallocate (mapgeoland2%ij_index) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif endif @@ -368,7 +368,7 @@ PROGRAM mkCatchParam write (log_file,'(a,a)')' --> ', trim(fname_tmp) inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' if (trim(LAIBCS) == 'GSWP2') then call process_gswp2_veg (nc,nr,regrid,'grnFrac',gridnamer) else @@ -378,16 +378,16 @@ PROGRAM mkCatchParam endif call hres_gswp2 (43200,21600, maparc30, gridnamer,'green') endif - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif fname_tmp = 'clsm/lai.dat' write (log_file,'(a,a)')' --> ', trim(fname_tmp) inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' redo_modis = .true. if (trim(LAIBCS) == 'GSWP2') call process_gswp2_veg (nc,nr,regrid,'LAI',gridnamer) @@ -427,20 +427,20 @@ PROGRAM mkCatchParam call grid2tile_glass (nc,nr,gridnamer,lai_name) endif - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif fname_tmp = 'clsm/ndvi.dat' write (log_file,'(a,a)')' --> ', trim(fname_tmp) inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call gimms_clim_ndvi (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -462,7 +462,7 @@ PROGRAM mkCatchParam write (log_file,'(a,a)')' --> ', trim(fname_tmp) inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' if(F25Tag) then call create_mapping (nc,nr,21600,10800,maparc60, gridnamer) call modis_alb_on_tiles_high (21600,10800,maparc60,MODALB,gridnamer) @@ -472,9 +472,9 @@ PROGRAM mkCatchParam ! This option is for legacy sets like Fortuna 2.1 call modis_alb_on_tiles (nc,nr,ease_grid,regrid,gridnamet,gridnamer) endif - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif endif @@ -483,11 +483,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a)')' --> ', trim(fname_tmp) inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call modis_alb_on_tiles_high (43200,21600,maparc30,MODALB,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif endif write (log_file,'(a)')' ' @@ -512,7 +512,7 @@ PROGRAM mkCatchParam inquire(file=trim(fname_tmp2), exist=file_exists2) if ((redo_modis).or.(.not.file_exists).or.(.not.file_exists2)) then ! if(.not.F25Tag) then - write (log_file,'(a)')'Creating files...' + write (log_file,'(a)')' Creating files...' call modis_scale_para_high (ease_grid,MODALB,gridnamet) ! else ! This option is for legacy sets like Fortuna 2.1 @@ -522,9 +522,9 @@ PROGRAM mkCatchParam ! call REFORMAT_VEGFILES ! endif ! endif - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing files.' + write (log_file,'(a)')' Using existing files.' endif write (log_file,'(a)')' ' @@ -540,7 +540,7 @@ PROGRAM mkCatchParam if(SOILBCS=='NGDC') then write (log_file,'(a)')'Creating (intermediate) NGDC soil types file...' call create_soil_types_files (nc,nr,ease_grid,gridnamet,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' write (log_file,'(a)')' ' endif @@ -553,15 +553,15 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' if(SOILBCS=='NGDC') then if( F25Tag) call soil_para_high (nc,nr,regrid,gridnamer,F25Tag=F25Tag) if(.not.F25Tag) call soil_para_high (nc,nr,regrid,gridnamer) endif if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a,a)')'Using existing file.' + write (log_file,'(a,a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -577,12 +577,12 @@ PROGRAM mkCatchParam inquire(file=trim(fname_tmp3), exist=file_exists3) inquire(file=trim(fname_tmp4), exist=file_exists4) if ((.not.file_exists).or.(.not.file_exists2).or.(.not.file_exists3).or.(.not.file_exists4)) then - write (log_file,'(a)')'Creating files...' + write (log_file,'(a)')' Creating files...' if(SOILBCS=='NGDC') call create_model_para (MaskFile) if(SOILBCS=='HWSD') call create_model_para_woesten (MaskFile) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a,a)')'Using existing files.' + write (log_file,'(a,a)')' Using existing files.' endif write (log_file,'(a)')' ' @@ -600,9 +600,9 @@ PROGRAM mkCatchParam ! create this file only if matching veg types file already exists inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) if (file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call grid2tile_ndep_t2m_alb (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else write (log_file,'(a)')'Skipping step for lack of matching veg types file.' endif @@ -613,11 +613,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call CLM45_fixed_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -626,11 +626,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call CLM45_clim_parameters (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' @@ -639,11 +639,11 @@ PROGRAM mkCatchParam write (log_file,'(a,a,a,a)') trim(tmpstring), ' (', trim(fname_tmp), ')' inquire(file=trim(fname_tmp), exist=file_exists) if (.not.file_exists) then - write (log_file,'(a)')'Creating file...' + write (log_file,'(a)')' Creating file...' call map_country_codes (nc,nr,gridnamer) - write (log_file,'(a)')'Done.' + write (log_file,'(a)')' Done.' else - write (log_file,'(a)')'Using existing file.' + write (log_file,'(a)')' Using existing file.' endif write (log_file,'(a)')' ' diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 index 940506647..d517bfe14 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 @@ -3673,7 +3673,8 @@ SUBROUTINE create_model_para_woesten (Maskfile) form='formatted',status='unknown') endif - fout='clsm/soil_param.dat' + + fout='clsm/soil_param.dat' open (42,file=fout,action='write', & form='formatted',status='unknown') From 348f9bfd54d740560f921c7cead1888a4bf24741 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Wed, 19 Jan 2022 07:36:42 -0500 Subject: [PATCH 22/38] corrected and simplified logic for BCS output directory (make_bcs) --- .../Utils/Raster/make_bcs | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 885f80db4..98e541339 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -78,29 +78,26 @@ set CR = $RESET ####################################################################### -# Create Paths for EXP Directorie -####################################################################### +# +# Experiment directory (for BCS output) -# EXP Directory (for Output Data ) -# -------------------------------------------- - setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE - - echo "" - echo "Enter desired ${C1}output directory${CR} (incl. full path)" - echo " or press ENTER to use the default:" - echo " [${C2}${EXPDIR}${CR}]" - set NEWEXPDIR = $< - if( $NEWEXPDIR == '' ) then - mkdir -p $EXPDIR - if($EXPDIR == '') then - else - echo "${C1}\!\!\!\! NOTE: Chosen directory not empty. \!\!\!\!${CR} " - echo "${C1}\!\!\!\! Same resolution BCS will be overwritten. \!\!\!\!${CR} " - endif - else - mkdir -p $NEWEXPDIR - setenv EXPDIR $NEWEXPDIR - endif +# define default +setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE + +echo " " +echo "Enter desired BCS ${C1}output directory${CR} (incl. full path)" +echo " or press ENTER to use the default:" +echo " [${C2}${EXPDIR}${CR}]" +set NEWEXPDIR = $< + +if( $NEWEXPDIR != '' ) setenv EXPDIR $NEWEXPDIR + +mkdir -p $EXPDIR + +if($EXPDIR != '') then + echo "${C1}\!\!\!\! NOTE: Chosen directory not empty. \!\!\!\!${CR} " + echo "${C1}\!\!\!\! Same resolution BCS will be overwritten. \!\!\!\!${CR} " +endif ####################################################################### # From b7995098c07476088ce88fe20f3376f7a722d9d5 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Tue, 25 Jan 2022 09:21:12 -0500 Subject: [PATCH 23/38] typo --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 98e541339..85458e201 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -216,10 +216,10 @@ if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m set orslvs = O1 echo " " - echo " $------------------------------------------------------------------------------" + echo " ------------------------------------------------------------------------------" echo " ${C1}NOTE: With selection of EASE grid for the Atmospheric Horizontal Resolution${CR}," echo " ${C1} the Ocean resolution is irrelevant and set to $orslvs ${CR}" - echo " $------------------------------------------------------------------------------" + echo " ------------------------------------------------------------------------------" echo " " else echo " " From ce6d7e7a5104946b5863307a5e8cdbdd32731463 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Tue, 25 Jan 2022 13:34:51 -0500 Subject: [PATCH 24/38] adding help message --- .../Utils/Raster/make_bcs | 63 +++++++++++-------- 1 file changed, 36 insertions(+), 27 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 85458e201..570c1dcef 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -1,31 +1,40 @@ -#!/bin/tcsh -f - -####################################################################### -# This script creates surface tiles, and writes all model input files -# (.til [tiles], .rst [raster] and land parameters) in BCSDIR for any -# specified combination of atmospheric and ocean grid resolutions. -# -# ---- USAGE ---- -# -# STEP 1: Build the model (GCM or GEOSldas). -# STEP 2: cd [install-path]/bin -# STEP 3: ./make_bcs -# Answer the following interactive questions: -# a) Enter Atmospheric Horizontal Resolution Code(s) to build. -# b) Select Land BCs version to use. -# c) Enter Ocean Resolution Code(s) to build. -# (Selection not relevant for land-only EASE grids.) -# d) Enter sponsor code. -# -# To skip the generation of land parameter files (i.e., mkCatchParam.x), -# use: ./make_bcs noland -# This option can potentially save time when additional bcs are created -# that have the exact same land parameters as an existing set of bcs -# because the only difference between the two sets of bcs is the -# [non-tripolar] ocean resolution. -# +#!/bin/tcsh -f + +################################################################################ +# Help # +################################################################################ + +if ( "$1" == "-h" ) then + echo "Usage: `basename $0` [option]" + +echo "-------------------------------------------------------------------------" +echo " Boundary Conditions Package " +echo " This script creates surface tiles, and writes all model input files " +echo " (.til [tiles], .rst [raster] and land parameters) in BCSDIR for any " +echo " specified combination of atmospheric and ocean grid resolutions. " +echo "-------------------------------------------------------------------------" +echo " ---- USAGE ---- " +echo " STEP 1: Build the model (GCM or GEOSldas). " +echo " STEP 2: cd [install-path]/bin " +echo " STEP 3: ./make_bcs " +echo " Answer the following interactive questions: " +echo " a) Enter Atmospheric Horizontal Resolution Code(s) to build." +echo " b) Select Land BCs version to use. " +echo " c) Enter Ocean Resolution Code(s) to build. " +echo " (Selection not relevant for land-only EASE grids.) " +echo " d) Enter sponsor code. " +echo " " +echo " To skip the generation of land parameter files (i.e., mkCatchParam.x), " +echo " use: ./make_bcs noland " +echo " This option can potentially save time when additional bcs are created " +echo " that have the exact same land parameters as an existing set of bcs " +echo " because the only difference between the two sets of bcs is the " +echo " [non-tripolar] ocean resolution. " +exit +endif ####################################################################### + # process input arguments set SKIPLAND = NO @@ -78,7 +87,7 @@ set CR = $RESET ####################################################################### -# + # Experiment directory (for BCS output) # define default From 16c866ed232fc8b712fcd7bb431ea025946176ac Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Wed, 26 Jan 2022 09:51:05 -0500 Subject: [PATCH 25/38] expanded make_bcs -help option; cleanup --- .../Utils/Raster/make_bcs | 391 ++++++++++-------- 1 file changed, 213 insertions(+), 178 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 570c1dcef..9ebb2067d 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -4,62 +4,71 @@ # Help # ################################################################################ -if ( "$1" == "-h" ) then - echo "Usage: `basename $0` [option]" +set HELPMODE = NO +if ( "$1" == "-h" | "$1" == "-help" | "$1" == "--help" ) set HELPMODE = YES + +if ( $HELPMODE == YES ) then + + echo "Usage: `basename $0` [option]" -echo "-------------------------------------------------------------------------" -echo " Boundary Conditions Package " -echo " This script creates surface tiles, and writes all model input files " -echo " (.til [tiles], .rst [raster] and land parameters) in BCSDIR for any " -echo " specified combination of atmospheric and ocean grid resolutions. " -echo "-------------------------------------------------------------------------" -echo " ---- USAGE ---- " -echo " STEP 1: Build the model (GCM or GEOSldas). " -echo " STEP 2: cd [install-path]/bin " -echo " STEP 3: ./make_bcs " -echo " Answer the following interactive questions: " -echo " a) Enter Atmospheric Horizontal Resolution Code(s) to build." -echo " b) Select Land BCs version to use. " -echo " c) Enter Ocean Resolution Code(s) to build. " -echo " (Selection not relevant for land-only EASE grids.) " -echo " d) Enter sponsor code. " -echo " " -echo " To skip the generation of land parameter files (i.e., mkCatchParam.x), " -echo " use: ./make_bcs noland " -echo " This option can potentially save time when additional bcs are created " -echo " that have the exact same land parameters as an existing set of bcs " -echo " because the only difference between the two sets of bcs is the " -echo " [non-tripolar] ocean resolution. " -exit + echo "-------------------------------------------------------------------------" + echo " Boundary Conditions Package " + echo " This script creates surface tiles, and writes all model input files " + echo " (.til [tiles], .rst [raster] and land parameters) in BCSDIR for any " + echo " specified combination of atmospheric and ocean grid resolutions. " + echo "-------------------------------------------------------------------------" + echo " " + echo " STEP 1: Build the model (GCM or GEOSldas). " + echo " STEP 2: cd [install-path]/bin " + echo " STEP 3: ./make_bcs " + echo " Answer the following interactive questions: " + echo " a) Enter BCS output directory. " + echo " b) Enter Atmospheric Horizontal Resolution Code(s) to build. " + echo " c) Select Land BCs version to use. " + echo " d) Enter Ocean Resolution Code(s) to build. " + echo " (Selection not relevant for land-only EASE grids.) " + echo " e) Enter sponsor code for computing account. " + echo " " + echo " To skip the generation of land parameter files (i.e., mkCatchParam.x), " + echo " use: ./make_bcs -noland " + echo " This option saves time when additional bcs are created that have the " + echo " exact same land parameters as an existing set of bcs because the only" + echo " difference between the two sets of bcs is the [non-tripolar] ocean " + echo " resolution. " + endif -####################################################################### +####################################################################### # process input arguments set SKIPLAND = NO -if ( $1 == noland ) set SKIPLAND = YES +if ( "$1" == "-noland" ) set SKIPLAND = YES ####################################################################### # Set GEOS5/ESMADIR Variables ####################################################################### -set MAKE_BCS = `echo $cwd`/make_bcs -set ESMADIR = `echo $cwd` +if ( $HELPMODE != YES ) then -echo ' ' -echo MAKE_BCS: $MAKE_BCS -echo ESMADIR: $ESMADIR + set MAKE_BCS = `echo $cwd`/make_bcs + set ESMADIR = `echo $cwd` -echo $ESMADIR/g5_modules -source $ESMADIR/g5_modules + echo ' ' + echo MAKE_BCS: $MAKE_BCS + echo ESMADIR: $ESMADIR -setenv NCPUS `/usr/bin/lscpu | grep '^CPU(s)' | cut -d ':' -f2 | head -1 ` -@ NCPUS = $NCPUS / 4 -@ NCPUS = $NCPUS * 3 -set NCPUS = 20 -setenv OMP_NUM_THREADS 1 + echo $ESMADIR/g5_modules + source $ESMADIR/g5_modules + setenv NCPUS `/usr/bin/lscpu | grep '^CPU(s)' | cut -d ':' -f2 | head -1 ` + @ NCPUS = $NCPUS / 4 + @ NCPUS = $NCPUS * 3 + set NCPUS = 20 + setenv OMP_NUM_THREADS 1 + +endif + ####################################################################### # Define Colors # Note: For No Colors, set C1 and C2 to NONE @@ -85,6 +94,8 @@ set C1 = $RED set C2 = $BLUE set CR = $RESET +echo "${CR}" + ####################################################################### @@ -93,92 +104,104 @@ set CR = $RESET # define default setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE -echo " " -echo "Enter desired BCS ${C1}output directory${CR} (incl. full path)" -echo " or press ENTER to use the default:" -echo " [${C2}${EXPDIR}${CR}]" -set NEWEXPDIR = $< +if ( $HELPMODE != YES ) then + + echo " " + echo "Enter desired BCS ${C1}output directory${CR} (incl. full path)" + echo " or press ENTER to use the default:" + echo " [${C2}${EXPDIR}${CR}]" + set NEWEXPDIR = $< -if( $NEWEXPDIR != '' ) setenv EXPDIR $NEWEXPDIR + if( $NEWEXPDIR != '' ) setenv EXPDIR $NEWEXPDIR -mkdir -p $EXPDIR + mkdir -p $EXPDIR -if($EXPDIR != '') then - echo "${C1}\!\!\!\! NOTE: Chosen directory not empty. \!\!\!\!${CR} " - echo "${C1}\!\!\!\! Same resolution BCS will be overwritten. \!\!\!\!${CR} " + if($EXPDIR != '') then + echo "${C1}\!\!\!\! NOTE: Chosen directory not empty. \!\!\!\!${CR} " + echo "${C1}\!\!\!\! Same resolution BCS will be overwritten. \!\!\!\!${CR} " + endif + endif ####################################################################### # # Atmospheric Horizontal Resolution (HRCODE) -echo " " -echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR}to be built:" -echo "------------------------------------------------------------------------------------------------------------------" -echo " Lat/Lon Cubed-Sphere EASE (land-only)" -echo "------------------------------------------------------------------------------------------------------------------" -echo " ${C2}b -- 2 deg ${CR} ${C2}c12 -- 8 deg ${CR} ${C2}m1 -- 1km EASEv2 Grid ${CR}" -echo " ${C2}c -- 1 deg ${CR} ${C2}c24 -- 4 deg ${CR} ${C2}m3 -- 3km EASEv2 Grid ${CR}" -echo " ${C2}d -- 1/2 deg ${CR} ${C2}c48 -- 2 deg ${CR} ${C2}m9 -- 9km EASEv2 Grid ${CR}" -echo " ${C2}e -- 1/4 deg ${CR} ${C2}c90 -- 1 deg ${CR} ${C2}m36 -- 36km EASEv2 Grid ${CR}" -echo " ${C2} c180 -- 1/2 deg (${C1} 56-km${C2}) ${CR} ${C2}m25 -- 25km EASEv1 Grid ${CR}" -echo " ${C2} c360 -- 1/4 deg (${C1} 28-km${C2}) ${CR}" -echo " ${C2} c720 -- 1/8 deg (${C1} 14-km${C2}) ${CR}" -echo " ${C2} c768 -- 1/10 deg (${C1} 12-km${C2}) ${CR}" -echo " ${C2} c1000 -- 1/10 deg (${C1} 10-km${C2}) ${CR}" -echo " ${C2} c1152 -- 1/10 deg (${C1} 8-km${C2}) ${CR}" -echo " ${C2} c1440 -- 1/16 deg (${C1} 7-km${C2}) ${CR}" -echo " ${C2} c1536 -- 1/16 deg (${C1} 7-km${C2}) ${CR}" -echo " ${C2} c2880 -- 1/32 deg (${C1} 3-km${C2}) ${CR}" -echo " ${C2} c3072 -- 1/32 deg (${C1} 3-km${C2}) ${CR}" -echo " ${C2} c5760 -- 1/64 deg (${C1}1.5-km${C2}) ${CR}" -echo " " +if ( $HELPMODE != YES ) then + echo "Enter 1-5 character alphanumeric code to select ${C1}Atmospheric Horizontal Resolution ${CR}to be built:" +else + echo "Options for ${C1}Atmospheric Horizontal Resolution${CR}:" +endif +echo " Lat/Lon Cubed-Sphere EASE (land-only)" +echo " ${C2}b -- 2 deg c12 -- 8 deg m1 -- 1km EASEv2 Grid ${CR}" +echo " ${C2}c -- 1 deg c24 -- 4 deg m3 -- 3km EASEv2 Grid ${CR}" +echo " ${C2}d -- 1/2 deg c48 -- 2 deg m9 -- 9km EASEv2 Grid ${CR}" +echo " ${C2}e -- 1/4 deg c90 -- 1 deg m36 -- 36km EASEv2 Grid ${CR}" +echo " ${C2} c180 -- 1/2 deg ${C1}( 56 km) ${CR} ${C2}m25 -- 25km EASEv1 Grid ${CR}" +echo " ${C2} c360 -- 1/4 deg ${C1}( 28 km) ${CR}" +echo " ${C2} c720 -- 1/8 deg ${C1}( 14 km) ${CR}" +echo " ${C2} c768 -- 1/10 deg ${C1}( 12 km) ${CR}" +echo " ${C2} c1000 -- 1/10 deg ${C1}( 10 km) ${CR}" +echo " ${C2} c1152 -- 1/10 deg ${C1}( 8 km) ${CR}" +echo " ${C2} c1440 -- 1/16 deg ${C1}( 7 km) ${CR}" +echo " ${C2} c1536 -- 1/16 deg ${C1}( 7 km) ${CR}" +echo " ${C2} c2880 -- 1/32 deg ${C1}( 3 km) ${CR}" +echo " ${C2} c3072 -- 1/32 deg ${C1}( 3 km) ${CR}" +echo " ${C2} c5760 -- 1/64 deg ${C1}( 1.5 km) ${CR}" #echo " ${C2}o -- other${CR} Lat/Lon or Cube" echo " " HRCODE: -set dummy = `echo $<` -set dummy = `echo $dummy | tr "[:upper:]" "[:lower:]"` -set HRCODES = $dummy[1] - -foreach HRCODE ($dummy) - if( $HRCODE != 'o' & \ - $HRCODE != 'b' & \ - $HRCODE != 'c' & \ - $HRCODE != 'd' & \ - $HRCODE != 'e' & \ - $HRCODE != 'c12' & \ - $HRCODE != 'c24' & \ - $HRCODE != 'c48' & \ - $HRCODE != 'c90' & \ - $HRCODE != 'c180' & \ - $HRCODE != 'c360' & \ - $HRCODE != 'c720' & \ - $HRCODE != 'c768' & \ - $HRCODE != 'c1000' & \ - $HRCODE != 'c1152' & \ - $HRCODE != 'c1440' & \ - $HRCODE != 'c1536' & \ - $HRCODE != 'c2880' & \ - $HRCODE != 'c3072' & \ - $HRCODE != 'c5760' & \ - $HRCODE != 'm1' & \ - $HRCODE != 'm3' & \ - $HRCODE != 'm9' & \ - $HRCODE != 'm36' & \ - $HRCODE != 'm25') then - echo " " - echo " ${C1} Invalid choice, try again:${CR}" - goto HRCODE +if ( $HELPMODE != YES ) then + set dummy = `echo $<` + set dummy = `echo $dummy | tr "[:upper:]" "[:lower:]"` + set HRCODES = $dummy[1] + + foreach HRCODE ($dummy) + if( $HRCODE != 'o' & \ + $HRCODE != 'b' & \ + $HRCODE != 'c' & \ + $HRCODE != 'd' & \ + $HRCODE != 'e' & \ + $HRCODE != 'c12' & \ + $HRCODE != 'c24' & \ + $HRCODE != 'c48' & \ + $HRCODE != 'c90' & \ + $HRCODE != 'c180' & \ + $HRCODE != 'c360' & \ + $HRCODE != 'c720' & \ + $HRCODE != 'c768' & \ + $HRCODE != 'c1000' & \ + $HRCODE != 'c1152' & \ + $HRCODE != 'c1440' & \ + $HRCODE != 'c1536' & \ + $HRCODE != 'c2880' & \ + $HRCODE != 'c3072' & \ + $HRCODE != 'c5760' & \ + $HRCODE != 'm1' & \ + $HRCODE != 'm3' & \ + $HRCODE != 'm9' & \ + $HRCODE != 'm36' & \ + $HRCODE != 'm25') then + echo " " + echo " ${C1} Invalid choice, try again:${CR}" + goto HRCODE + endif + if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` + end + + if( $HRCODE == o ) then + echo "Enter the Atmospheric ${C1}Horizontal Resolution${CR}: ${C2}IM JM${CR}" + echo " Note for ${C1}Cubed-Sphere${CR}: ${C2}JM must equal 6*IM${CR}" + set Resolution = `echo $<` endif - if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` -end -if( $HRCODE == o ) then - echo "Enter the Atmospheric ${C1}Horizontal Resolution${CR}: ${C2}IM JM${CR}" - echo " Note for ${C1}Cubed-Sphere${CR}: ${C2}JM must equal 6*IM${CR}" - set Resolution = `echo $<` -endif +else + set HRCODE = null + set HRCODES = null + +endif + ####################################################################### # # Land bcs version (LBCSV) @@ -187,85 +210,97 @@ endif set lbcsv = NL3 LBCSV: -echo " " -echo "Enter 3-character alphanumeric code to select specific ${C1}Land BCs version ${CR} to use:" -echo " Choose: ${C2}F25 : Fortuna-2_5" -echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" -echo " ${C2}ICA : Icarus (/discover/nobackup/ltakacs/bcs/Icarus/)" -echo " ${C2}NL3 : Icarus-NLv3 (/discover/nobackup/ltakacs/bcs/Icarus-NLv3/)" -echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_NLv4/NLv4/)" -echo " ${C2}NL5 : NLv5 [SMAP]" -echo " ${C2}DEV : development version" -echo " " -echo " NOTE: Due to compiler differences, code improvements and bug fixes that" -echo " have taken place since the above archived BCs were created, some parameter" -echo " files produced by current source code may differ from those in the archived BCs." -echo " Nevertheless, the impact of these differences on science is insignificant and" -echo " the parameter files produced by current source code is considered to be" -echo " scientifically equivalent to the corresponding archived BCs" -echo " " -echo " OR press ENTER to select $lbcsv (current default).${CR}" -echo " " -set dummy = `echo $<` -set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` -if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') then - set lbcsv = $dummy -else if ( $dummy == '' ) then +if ( $HELPMODE != YES ) then + echo "Enter 3-character alphanumeric code to select ${C1}Land BCs version ${CR} to use:" else - echo "You selected lbcsv=$dummy \!\!\!\! Invalid Version, stopping \!\!\!\! " - exit + echo "Options for ${C1}Land BCs version${CR}:" +endif +echo " ${C2}F25 : Fortuna-2_5" +echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" +echo " ${C2}ICA : Icarus (/discover/nobackup/ltakacs/bcs/Icarus/)" +echo " ${C2}NL3 : Icarus-NLv3 (/discover/nobackup/ltakacs/bcs/Icarus-NLv3/)" +echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_NLv4/NLv4/)" +echo " ${C2}NL5 : NLv5 [SMAP]" +echo " ${C2}DEV : Development version${CR}" +echo " " +if ( $HELPMODE != YES ) then + echo " NOTE: Due to compiler differences, code improvements and bug fixes that" + echo " have taken place since the above archived BCs were created, some parameter" + echo " files produced by current source code may differ from those in the archived BCs." + echo " Nevertheless, the impact of these differences on science is insignificant and" + echo " the parameter files produced by current source code is considered to be" + echo " scientifically equivalent to the corresponding archived BCs" + echo " " + echo " OR press ENTER to select $lbcsv (current default).${CR}" + echo " " endif +if ( $HELPMODE != YES ) then + set dummy = `echo $<` + set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` + if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') then + set lbcsv = $dummy + else if ( $dummy == '' ) then + else + echo "You selected lbcsv=$dummy \!\!\!\! Invalid Version, stopping \!\!\!\! " + exit + endif +endif ####################################################################### # # Ocean Horizontal Resolution (ORSLV) if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m25) then - set orslvs = O1 - - echo " " - echo " ------------------------------------------------------------------------------" - echo " ${C1}NOTE: With selection of EASE grid for the Atmospheric Horizontal Resolution${CR}," - echo " ${C1} the Ocean resolution is irrelevant and set to $orslvs ${CR}" - echo " ------------------------------------------------------------------------------" - echo " " + set orslvs = O1 + + echo " ------------------------------------------------------------------------------" + echo " ${C1}NOTE: With selection of EASE grid for the Atmospheric Horizontal Resolution${CR}," + echo " ${C1} the Ocean resolution is irrelevant and set to $orslvs ${CR}" + echo " ------------------------------------------------------------------------------" + echo " " else - echo " " - echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR}to be built:" - echo " Choose: ${C2}O1 -- Low-Resolution Reynolds 1 deg${CR} (Lon/Lat Data-Ocean: 360x180) " - echo " ${C2}O2 -- Med-Resolution Reynolds 1/4 deg${CR} (Lon/Lat Data-Ocean: 1440x720) " - echo " ${C2}O3 -- High-Resolution OSTIA 1/8 deg${CR} (Lon/Lat Data-Ocean: 2880x1440) " - echo " ${C2}T2 -- Med-Resolution Tripolar 1 deg${CR} (MOM-Tripolar-Ocean: 360x200) " - echo " ${C2}T3 -- High-Resolution Tripolar 1/2 deg${CR} (MOM-Tripolar-Ocean: 720x410) " - echo " ${C2}T4 -- High-Resolution Tripolar 1/4 deg${CR} (MOM-Tripolar-Ocean: 1440x1080) " - echo " ${C2}T1MOM6 -- Low-Resolution Tripolar 5 deg${CR} (MOM6-Tripolar-Ocean: 72x36) " -# echo " ${C2}T2MOM6 -- Med-Resolution Tripolar 1 deg${CR} (MOM6-Tripolar-Ocean: 360x210) " - echo " ${C2}T4MOM6 -- High-Resolution Tripolar 1/4 deg${CR} (MOM6-Tripolar-Ocean: 1440x1080) " - echo " ${C2}CS -- Cubed-Sphere Ocean ${CR} (Cubed-Sphere Data-Ocean ) " - echo " " + if ( $HELPMODE != YES ) then + echo "Enter 2-6 character alphanumeric code (no dashes) to select ${C1}Ocean Resolution ${CR}to be built:" + else + echo "Options for ${C1}Ocean Resolution${CR}:" + endif + echo " ${C2}O1 -- Low-Resolution Reynolds 1 deg${CR} (Lon/Lat Data-Ocean: 360x180 )" + echo " ${C2}O2 -- Med-Resolution Reynolds 1/4 deg${CR} (Lon/Lat Data-Ocean: 1440x720 )" + echo " ${C2}O3 -- High-Resolution OSTIA 1/8 deg${CR} (Lon/Lat Data-Ocean: 2880x1440)" + echo " ${C2}T2 -- Med-Resolution Tripolar 1 deg${CR} (MOM-Tripolar-Ocean: 360x200 )" + echo " ${C2}T3 -- High-Resolution Tripolar 1/2 deg${CR} (MOM-Tripolar-Ocean: 720x410 )" + echo " ${C2}T4 -- High-Resolution Tripolar 1/4 deg${CR} (MOM-Tripolar-Ocean: 1440x1080)" + echo " ${C2}T1MOM6 -- Low-Resolution Tripolar 5 deg${CR} (MOM6-Tripolar-Ocean: 72x36 )" +# echo " ${C2}T2MOM6 -- Med-Resolution Tripolar 1 deg${CR} (MOM6-Tripolar-Ocean: 360x210 )" + echo " ${C2}T4MOM6 -- High-Resolution Tripolar 1/4 deg${CR} (MOM6-Tripolar-Ocean: 1440x1080)" + echo " ${C2}CS -- Cubed-Sphere Ocean ${CR} (Cubed-Sphere Data-Ocean )" + echo " " + + if ( $HELPMODE == YES ) exit + ORSLV: - set dummy = `echo $<` - set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` - set orslvs = $dummy[1] - foreach orslv ($dummy) - if( $orslv != 'O1' & \ - $orslv != 'O2' & \ - $orslv != 'O3' & \ - $orslv != 'T2' & \ - $orslv != 'T3' & \ - $orslv != 'T4' & \ - $orslv != 'T1MOM6' & \ - $orslv != 'T2MOM6' & \ - $orslv != 'T4MOM6' & \ - $orslv != 'CS') then - echo " " - echo " ${C1} Invalid choice, try again:${CR}" - goto ORSLV - endif + set dummy = `echo $<` + set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` + set orslvs = $dummy[1] + foreach orslv ($dummy) + if( $orslv != 'O1' & \ + $orslv != 'O2' & \ + $orslv != 'O3' & \ + $orslv != 'T2' & \ + $orslv != 'T3' & \ + $orslv != 'T4' & \ + $orslv != 'T1MOM6' & \ + $orslv != 'T2MOM6' & \ + $orslv != 'T4MOM6' & \ + $orslv != 'CS') then + echo " " + echo " ${C1} Invalid choice, try again:${CR}" + goto ORSLV + endif if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` - if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` - end + if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` + end endif From e6033d955787bf93f7c1b8ca5da365fe1f4a4921 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Thu, 27 Jan 2022 09:05:58 -0500 Subject: [PATCH 26/38] sourcing g5_modules insted of setting env --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 9ebb2067d..6d942a820 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -20,7 +20,8 @@ if ( $HELPMODE == YES ) then echo " " echo " STEP 1: Build the model (GCM or GEOSldas). " echo " STEP 2: cd [install-path]/bin " - echo " STEP 3: ./make_bcs " + echo " STEP 3: source g5_modules.sh " + echo " STEP 4: ./make_bcs " echo " Answer the following interactive questions: " echo " a) Enter BCS output directory. " echo " b) Enter Atmospheric Horizontal Resolution Code(s) to build. " @@ -51,16 +52,6 @@ if ( "$1" == "-noland" ) set SKIPLAND = YES if ( $HELPMODE != YES ) then - set MAKE_BCS = `echo $cwd`/make_bcs - set ESMADIR = `echo $cwd` - - echo ' ' - echo MAKE_BCS: $MAKE_BCS - echo ESMADIR: $ESMADIR - - echo $ESMADIR/g5_modules - source $ESMADIR/g5_modules - setenv NCPUS `/usr/bin/lscpu | grep '^CPU(s)' | cut -d ':' -f2 | head -1 ` @ NCPUS = $NCPUS / 4 @ NCPUS = $NCPUS * 3 @@ -676,7 +667,6 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR @@ -855,7 +845,6 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR @@ -925,7 +914,6 @@ cat << _EOF_ > $BCJOB-2 #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR @@ -1058,7 +1046,6 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR @@ -1257,7 +1244,6 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR From 039f343cbb85abe361b7fa32b1173385331d92e9 Mon Sep 17 00:00:00 2001 From: Rolf Reichle <54944691+gmao-rreichle@users.noreply.github.com> Date: Thu, 27 Jan 2022 09:40:54 -0500 Subject: [PATCH 27/38] clarified "source g5_modules" instruction --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 6d942a820..f4f974c2d 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -20,7 +20,7 @@ if ( $HELPMODE == YES ) then echo " " echo " STEP 1: Build the model (GCM or GEOSldas). " echo " STEP 2: cd [install-path]/bin " - echo " STEP 3: source g5_modules.sh " + echo " STEP 3: source g5_modules (for bash or zsh use g5_modules.[z]sh) " echo " STEP 4: ./make_bcs " echo " Answer the following interactive questions: " echo " a) Enter BCS output directory. " From 46d66052bc292ec48b8ba0067effea8e07cb4844 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Fri, 28 Jan 2022 08:16:07 -0500 Subject: [PATCH 28/38] out dir re-org, remove g5_modules, fix latlon option --- .../Utils/Raster/make_bcs | 75 ++++++++++++------- 1 file changed, 46 insertions(+), 29 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index f4f974c2d..55d85c0c2 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -107,10 +107,15 @@ if ( $HELPMODE != YES ) then mkdir -p $EXPDIR - if($EXPDIR != '') then - echo "${C1}\!\!\!\! NOTE: Chosen directory not empty. \!\!\!\!${CR} " - echo "${C1}\!\!\!\! Same resolution BCS will be overwritten. \!\!\!\!${CR} " - endif +set foo=`ls -a ${EXPDIR} | wc -l` +if ( "${foo}" == 2 ) then + echo "${C2} ${EXPDIR} is empty ${CR}" + echo " " +else + echo "${C1} WARNING: ${EXPDIR} is not empty ${CR}" + echo " " +endif + endif @@ -305,6 +310,23 @@ echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" ####################################################################### ####################################################################### +set NEWBCS = $EXPDIR/${HRCODES}_${orslvs}_${lbcsv} +mkdir -p $NEWBCS + +set foo=`ls -a $NEWBCS | wc -l` +if ( "${foo}" == 2 ) then +else + echo "" + echo "${C1} ----------------------------------------------------${CR}" + echo "${C2} Abort: $NEWBCS is not empty ${CR}" + echo "${C2} Please delete same resolution BCS files and resubmit" + echo "${C1} ----------------------------------------------------${CR}" + echo "" + exit +endif + +####################################### + set IRRIGTHRES = 2 set make_bcs_jobs = '' @@ -646,20 +668,20 @@ set DATENAME = DE set POLENAME = PE set BCNAME = DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO} -set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch +set BCDIR = $NEWBCS/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j if( -e $BCDIR) /bin/rm -r $BCDIR mkdir -p $BCDIR -mkdir -p $EXPDIR/$OUTDIR/logs +mkdir -p $NEWBCS/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -686,7 +708,6 @@ cd ../ if( -e DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO}.stdout ) /bin/rm -f DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO}.stdout setenv MASKFILE $MASKFILE -source bin/g5_modules limit stacksize unlimited bin/mkLatLonRaster.x -x ${NX} -y ${NY} -t -1 ${IM} ${JM} >/dev/null bin/mkLandRaster.x -x ${NX} -y ${NY} -v -t ${NT} @@ -789,7 +810,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME -/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -823,12 +844,12 @@ else set BCNAME = CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO} endif -set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch +set BCDIR = $NEWBCS/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j if( -e $BCDIR) /bin/rm -r $BCDIR mkdir -p $BCDIR -mkdir -p $EXPDIR/$OUTDIR/logs +mkdir -p $NEWBCS/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -836,8 +857,8 @@ if ($HRCODE == c2880 | $HRCODE == c3072 | $HRCODE == c5760) then cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=1 @@ -864,7 +885,6 @@ cd ../ if( -e CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO}.stdout ) /bin/rm -f CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO}.stdout setenv MASKFILE $MASKFILE -source bin/g5_modules limit stacksize unlimited bin/mkCubeFVRaster.x -x ${NX} -y ${NY} ${NC} >/dev/null bin/mkLandRaster.x -x ${NX} -y ${NY} -v -t ${NT} @@ -905,8 +925,8 @@ set make_bcs_jobs = `echo $make_bcs_jobs $BCJOB` cat << _EOF_ > $BCJOB-2 #!/bin/csh -x -#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME-2.log -#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME-2.err +#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME-2.log +#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME-2.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -919,7 +939,6 @@ cd $pwd cd $BCDIR setenv MASKFILE $MASKFILE -source bin/g5_modules limit stacksize unlimited if( $LATLON_OCEAN == TRUE ) then @@ -1022,7 +1041,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB-2 $BCNAME -/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -1037,8 +1056,8 @@ else cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1065,7 +1084,6 @@ cd ../ if( -e CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO}.stdout ) /bin/rm -f CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO}.stdout setenv MASKFILE $MASKFILE -source bin/g5_modules limit stacksize unlimited bin/mkCubeFVRaster.x -x ${NX} -y ${NY} ${NC} >/dev/null bin/mkLandRaster.x -x ${NX} -y ${NY} -v -t ${NT} @@ -1190,7 +1208,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME -/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -1222,12 +1240,12 @@ set IM = `echo ${im} | awk '{printf "%4.4i", $1}'` set JM = `echo ${jm} | awk '{printf "%4.4i", $1}'` set BCNAME = SMAP_${EVERSION}_${MGRID} -set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch +set BCDIR = $NEWBCS/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j set THISGRID = SMAP-${EVERSION}-${MGRID} if( -e $BCDIR) /bin/rm -r $BCDIR mkdir -p $BCDIR -mkdir -p $EXPDIR/$OUTDIR/logs +mkdir -p $NEWBCS/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -1235,8 +1253,8 @@ echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1252,7 +1270,6 @@ mkdir -p til rst data/MOM5 data/MOM6 clsm/plots cd data ln -s $l_data CATCH cd ../ -source bin/g5_modules limit stacksize unlimited if ( $EVERSION == EASEv2 ) then setenv MASKFILE ${MASKFILE} @@ -1347,7 +1364,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME -/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. +/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR From e8e7e76e10f5c17cd7c923f28893e3381a6ce992 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Fri, 28 Jan 2022 08:23:15 -0500 Subject: [PATCH 29/38] right commit --- .../GEOSsurface_GridComp/Utils/Raster/make_bcs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 55d85c0c2..ea7fe1ced 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -310,7 +310,11 @@ echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" ####################################################################### ####################################################################### -set NEWBCS = $EXPDIR/${HRCODES}_${orslvs}_${lbcsv} +set atmcode = `echo "$HRCODES" | tr " " _` +set oceancode = `echo "$orslvs" | tr " " _` + +set NEWBCS = $EXPDIR/${atmcode}_${oceancode}_${lbcsv} + mkdir -p $NEWBCS set foo=`ls -a $NEWBCS | wc -l` @@ -662,7 +666,6 @@ set IM = `echo ${im} | awk '{printf "%4.4i", $1}'` set JM = `echo ${jm} | awk '{printf "%4.4i", $1}'` set IMO = `echo ${imo} | awk '{printf "%4.4i", $1}'` set JMO = `echo ${jmo} | awk '{printf "%4.4i", $1}'` -set NC = `echo ${nc} | awk '{printf "%4.4i", $1}'` set DATENAME = DE set POLENAME = PE @@ -743,7 +746,7 @@ endif /bin/mv clsm clsm.${IM}x${JM} /bin/cp til/DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO}-Pfafstetter.til clsm.${IM}x${JM} -if( $TRIPOL_OCEAN == TRUE ) /bin/cp til/CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO}-Pfafstetter.TRN clsm.${IM}x${JM} +if( $TRIPOL_OCEAN == TRUE ) /bin/cp til/DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO}-Pfafstetter.TRN clsm.${IM}x${JM} /bin/rm clsm.${IM}x${JM}/DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO}-Pfafstetter.file cd clsm.${IM}x${JM} From a99f23032725a7c1b2e629ef2d33fc896c153343 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Mon, 31 Jan 2022 08:41:47 -0500 Subject: [PATCH 30/38] fix previous commit with diff dir check --- .../Utils/Raster/make_bcs | 126 ++++++++++-------- 1 file changed, 70 insertions(+), 56 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index ea7fe1ced..4296c7325 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -107,15 +107,14 @@ if ( $HELPMODE != YES ) then mkdir -p $EXPDIR -set foo=`ls -a ${EXPDIR} | wc -l` -if ( "${foo}" == 2 ) then - echo "${C2} ${EXPDIR} is empty ${CR}" - echo " " -else - echo "${C1} WARNING: ${EXPDIR} is not empty ${CR}" - echo " " -endif - + set foo=`ls -a ${EXPDIR} | wc -l` + if ( "${foo}" == 2 ) then + echo "${C2} ${EXPDIR} is empty ${CR}" + echo " " + else + echo "${C1} WARNING: ${EXPDIR} is not empty ${CR}" + echo " " + endif endif @@ -294,8 +293,7 @@ ORSLV: echo " ${C1} Invalid choice, try again:${CR}" goto ORSLV endif - if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` - if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` + if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` end endif @@ -310,27 +308,6 @@ echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" ####################################################################### ####################################################################### -set atmcode = `echo "$HRCODES" | tr " " _` -set oceancode = `echo "$orslvs" | tr " " _` - -set NEWBCS = $EXPDIR/${atmcode}_${oceancode}_${lbcsv} - -mkdir -p $NEWBCS - -set foo=`ls -a $NEWBCS | wc -l` -if ( "${foo}" == 2 ) then -else - echo "" - echo "${C1} ----------------------------------------------------${CR}" - echo "${C2} Abort: $NEWBCS is not empty ${CR}" - echo "${C2} Please delete same resolution BCS files and resubmit" - echo "${C1} ----------------------------------------------------${CR}" - echo "" - exit -endif - -####################################### - set IRRIGTHRES = 2 set make_bcs_jobs = '' @@ -671,20 +648,32 @@ set DATENAME = DE set POLENAME = PE set BCNAME = DC${IM}xPC${JM}_${DATENAME}${IMO}x${POLENAME}${JMO} -set BCDIR = $NEWBCS/$OUTDIR/$BCNAME.scratch +set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j -if( -e $BCDIR) /bin/rm -r $BCDIR +set nfiles = `find $EXPDIR -maxdepth 5 -name ${BCNAME}".j" | wc -l` +if( $nfiles >= 1 ) then + echo "" + echo "${C1} ----------------------------------------------------${CR}" + echo "${C1} Abort: ${CR}" + echo "${C2} This BCS run $BCDIR ${CR}" + echo "${C2} will create resolution dir already present: $BCNAME ${CR}" + echo "${C2} Please delete run dir and same resolution BCS files and resubmit" + echo "${C1} ----------------------------------------------------${CR}" + echo "" + exit +endif + mkdir -p $BCDIR -mkdir -p $NEWBCS/$OUTDIR/logs +mkdir -p $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -813,7 +802,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME -/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -847,12 +836,24 @@ else set BCNAME = CF${NC}x6C_${DATENAME}${IMO}x${POLENAME}${JMO} endif -set BCDIR = $NEWBCS/$OUTDIR/$BCNAME.scratch +set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j -if( -e $BCDIR) /bin/rm -r $BCDIR +set nfiles = `find $EXPDIR -maxdepth 5 -name ${BCNAME}".j" | wc -l` +if( $nfiles >= 1 ) then + echo "" + echo "${C1} ----------------------------------------------------${CR}" + echo "${C1} Abort: ${CR}" + echo "${C2} This BCS run $BCDIR ${CR}" + echo "${C2} will create resolution dir already present: $BCNAME ${CR}" + echo "${C2} Please delete run dir and same resolution BCS files and resubmit" + echo "${C1} ----------------------------------------------------${CR}" + echo "" + exit +endif + mkdir -p $BCDIR -mkdir -p $NEWBCS/$OUTDIR/logs +mkdir -p $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -860,8 +861,8 @@ if ($HRCODE == c2880 | $HRCODE == c3072 | $HRCODE == c5760) then cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=1 @@ -928,8 +929,8 @@ set make_bcs_jobs = `echo $make_bcs_jobs $BCJOB` cat << _EOF_ > $BCJOB-2 #!/bin/csh -x -#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME-2.log -#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME-2.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME-2.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME-2.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1044,7 +1045,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB-2 $BCNAME -/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -1059,8 +1060,8 @@ else cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1211,7 +1212,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME -/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -1243,12 +1244,25 @@ set IM = `echo ${im} | awk '{printf "%4.4i", $1}'` set JM = `echo ${jm} | awk '{printf "%4.4i", $1}'` set BCNAME = SMAP_${EVERSION}_${MGRID} -set BCDIR = $NEWBCS/$OUTDIR/$BCNAME.scratch +set BCDIR = $EXPDIR/$OUTDIR/$BCNAME.scratch set BCJOB = $BCDIR/$BCNAME.j set THISGRID = SMAP-${EVERSION}-${MGRID} -if( -e $BCDIR) /bin/rm -r $BCDIR + +set nfiles = `find $EXPDIR -maxdepth 5 -name ${BCNAME}".j" | wc -l` +if( $nfiles >= 1 ) then + echo "" + echo "${C1} ----------------------------------------------------${CR}" + echo "${C1} Abort: ${CR}" + echo "${C2} This BCS run $BCDIR ${CR}" + echo "${C2} will create resolution dir already present: $BCNAME ${CR}" + echo "${C2} Please delete run dir and same resolution BCS files and resubmit" + echo "${C1} ----------------------------------------------------${CR}" + echo "" + exit +endif + mkdir -p $BCDIR -mkdir -p $NEWBCS/$OUTDIR/logs +mkdir -p $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -1256,8 +1270,8 @@ echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$NEWBCS/$OUTDIR/logs/$BCNAME.log -#SBATCH --error=$NEWBCS/$OUTDIR/logs/$BCNAME.err +#SBATCH --output=$EXPDIR/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1367,7 +1381,7 @@ cd ../ cd ../../ /bin/mv $BCDIR/$BCNAME . /bin/mv $BCJOB $BCNAME -/bin/mv $NEWBCS/$OUTDIR/logs $BCNAME/. +/bin/mv $EXPDIR/$OUTDIR/logs $BCNAME/. /bin/mv $BCNAME/clsm/mkCatchParam.log $BCNAME/logs/mkCatchParam.log /bin/rm -r $OUTDIR @@ -1402,9 +1416,9 @@ end # End Ocean Resolution Loop # end #else foreach job ($make_bcs_jobs) - set jobid="`sbatch $job | cut -d' ' -f4`" echo $jobid +echo $job if( -e $job-2) then set jobid="`sbatch --dependency=afterok:$jobid $make_bcs_jobs[2] | cut -d' ' -f4`" From 3541a12a1246aea801b454d903359548a7bf40ad Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Thu, 3 Feb 2022 18:24:21 -0500 Subject: [PATCH 31/38] fixed problems with interactive inputs, logic, and help text in make_bcs - fixed check for existing/empty output directory - fixed check for EASE grid and ocean resolution - revised help text --- .../Utils/Raster/make_bcs | 189 ++++++++++-------- 1 file changed, 111 insertions(+), 78 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index 4296c7325..dfc462c37 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -9,33 +9,32 @@ if ( "$1" == "-h" | "$1" == "-help" | "$1" == "--help" ) set HELPMODE = YES if ( $HELPMODE == YES ) then - echo "Usage: `basename $0` [option]" - - echo "-------------------------------------------------------------------------" - echo " Boundary Conditions Package " - echo " This script creates surface tiles, and writes all model input files " - echo " (.til [tiles], .rst [raster] and land parameters) in BCSDIR for any " - echo " specified combination of atmospheric and ocean grid resolutions. " - echo "-------------------------------------------------------------------------" - echo " " - echo " STEP 1: Build the model (GCM or GEOSldas). " - echo " STEP 2: cd [install-path]/bin " - echo " STEP 3: source g5_modules (for bash or zsh use g5_modules.[z]sh) " - echo " STEP 4: ./make_bcs " - echo " Answer the following interactive questions: " - echo " a) Enter BCS output directory. " - echo " b) Enter Atmospheric Horizontal Resolution Code(s) to build. " - echo " c) Select Land BCs version to use. " - echo " d) Enter Ocean Resolution Code(s) to build. " - echo " (Selection not relevant for land-only EASE grids.) " - echo " e) Enter sponsor code for computing account. " - echo " " - echo " To skip the generation of land parameter files (i.e., mkCatchParam.x), " - echo " use: ./make_bcs -noland " - echo " This option saves time when additional bcs are created that have the " - echo " exact same land parameters as an existing set of bcs because the only" - echo " difference between the two sets of bcs is the [non-tripolar] ocean " - echo " resolution. " + echo "Usage: `basename $0` [option] " + echo " " + echo "Boundary Conditions (BCs) Package: " + echo " Creates surface tile and other model parameter input files " + echo " (.til [tiles], .rst [raster], and land parameters) for " + echo " combinations of atmospheric resolution, ocean resolution, " + echo " and land BCs version. " + echo " " + echo " STEP 1: Build the model. (GCM or GEOSldas) " + echo " STEP 2: cd [install-path]/bin " + echo " STEP 3: source g5_modules (for bash or zsh use g5_modules.[z]sh) " + echo " STEP 4: ./make_bcs " + echo " Answer the following interactive questions: " + echo " a) Enter BCs output directory. " + echo " b) Select atmospheric horizontal resolution(s). " + echo " c) Select Land BCs version. " + echo " d) Select ocean resolution(s). " + echo " (Not relevant for land-only EASE-grid BCs.) " + echo " e) Enter sponsor code for computing account. " + echo " " + echo " To skip the generation of land parameter files (ie, mkCatchParam.x), " + echo " use: ./make_bcs -noland " + echo " This option saves time when additional bcs are created that have " + echo " the exact same land parameters as an existing set of bcs because " + echo " the only difference between the two sets of bcs is the [non-tripolar]" + echo " ocean resolution. " endif @@ -87,7 +86,6 @@ set CR = $RESET echo "${CR}" - ####################################################################### # Experiment directory (for BCS output) @@ -98,7 +96,7 @@ setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE if ( $HELPMODE != YES ) then echo " " - echo "Enter desired BCS ${C1}output directory${CR} (incl. full path)" + echo "Enter desired BCS output directory (incl. full path)" echo " or press ENTER to use the default:" echo " [${C2}${EXPDIR}${CR}]" set NEWEXPDIR = $< @@ -106,16 +104,10 @@ if ( $HELPMODE != YES ) then if( $NEWEXPDIR != '' ) setenv EXPDIR $NEWEXPDIR mkdir -p $EXPDIR - - set foo=`ls -a ${EXPDIR} | wc -l` - if ( "${foo}" == 2 ) then - echo "${C2} ${EXPDIR} is empty ${CR}" - echo " " - else - echo "${C1} WARNING: ${EXPDIR} is not empty ${CR}" - echo " " + if ($status>0) then + echo "mkdir ERROR! Exiting..." + exit endif - endif ####################################################################### @@ -123,9 +115,11 @@ endif # Atmospheric Horizontal Resolution (HRCODE) if ( $HELPMODE != YES ) then - echo "Enter 1-5 character alphanumeric code to select ${C1}Atmospheric Horizontal Resolution ${CR}to be built:" + echo " " + echo "Enter 1-5 character alphanumeric code(s) for atmospheric horizontal resolution:" + echo "(Separate multiple entries by spaces.)" else - echo "Options for ${C1}Atmospheric Horizontal Resolution${CR}:" + echo "Options for atmospheric horizontal resolution:" endif echo " Lat/Lon Cubed-Sphere EASE (land-only)" echo " ${C2}b -- 2 deg c12 -- 8 deg m1 -- 1km EASEv2 Grid ${CR}" @@ -145,9 +139,13 @@ echo " ${C2} c3072 -- 1/32 deg ${C1}( 3 km) ${CR}" echo " ${C2} c5760 -- 1/64 deg ${C1}( 1.5 km) ${CR}" #echo " ${C2}o -- other${CR} Lat/Lon or Cube" echo " " + HRCODE: if ( $HELPMODE != YES ) then + set dummy = `echo $<` + if (${%dummy} == 0) set dummy = "BLANK" + set dummy = `echo $dummy | tr "[:upper:]" "[:lower:]"` set HRCODES = $dummy[1] @@ -177,7 +175,6 @@ if ( $HELPMODE != YES ) then $HRCODE != 'm9' & \ $HRCODE != 'm36' & \ $HRCODE != 'm25') then - echo " " echo " ${C1} Invalid choice, try again:${CR}" goto HRCODE endif @@ -190,13 +187,28 @@ if ( $HELPMODE != YES ) then set Resolution = `echo $<` endif + # figure out if one or more of the selected atmospheric resolutions is an EASE grid + + set isEASE = 0 + + foreach HRCODE ($HRCODES) + if( $HRCODE == 'm1' | \ + $HRCODE == 'm3' | \ + $HRCODE == 'm9' | \ + $HRCODE == 'm36' | \ + $HRCODE == 'm25') then + set isEASE = 1 + endif + end + else set HRCODE = null set HRCODES = null endif - + + ####################################################################### # # Land bcs version (LBCSV) @@ -204,11 +216,11 @@ endif # set default land bcs version set lbcsv = NL3 -LBCSV: if ( $HELPMODE != YES ) then - echo "Enter 3-character alphanumeric code to select ${C1}Land BCs version ${CR} to use:" + echo " " + echo "Enter 3-character alphanumeric code for land BCs version (select only one):" else - echo "Options for ${C1}Land BCs version${CR}:" + echo "Options for land BCs version:" endif echo " ${C2}F25 : Fortuna-2_5" echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" @@ -230,35 +242,51 @@ if ( $HELPMODE != YES ) then echo " " endif +LBCSV: if ( $HELPMODE != YES ) then + set dummy = `echo $<` + set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` - if( $dummy == 'F25' | $dummy == 'GM4' | $dummy == 'ICA' | $dummy == 'NL3' | $dummy == 'NL4' | $dummy == 'NL5'| $dummy == 'DEV') then + + if( $dummy == 'F25' | \ + $dummy == 'GM4' | \ + $dummy == 'ICA' | \ + $dummy == 'NL3' | \ + $dummy == 'NL4' | \ + $dummy == 'NL5' | \ + $dummy == 'DEV') then set lbcsv = $dummy else if ( $dummy == '' ) then + echo $lbcsv else - echo "You selected lbcsv=$dummy \!\!\!\! Invalid Version, stopping \!\!\!\! " - exit + echo " " + echo " ${C1} Invalid choice, try again:${CR}" + goto LBCSV endif endif ####################################################################### # # Ocean Horizontal Resolution (ORSLV) - -if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m25) then + +if ($isEASE > 0) then set orslvs = O1 - echo " ------------------------------------------------------------------------------" - echo " ${C1}NOTE: With selection of EASE grid for the Atmospheric Horizontal Resolution${CR}," - echo " ${C1} the Ocean resolution is irrelevant and set to $orslvs ${CR}" - echo " ------------------------------------------------------------------------------" + echo " ${C1}---------------------------------------------------------------------- ${CR}" + echo " ${C1} Selected atmospheric resolution(s) include(s) EASE grid(s). ${CR}" + echo " ${C1} Setting ocean resolution to $orslvs \!\!\! ${CR}" + echo " ${C1} For a choice of ocean resolutions, exclude EASE grid selection(s) ${CR}" + echo " ${C1} from selected atmospheric resolution(s) and process separately. ${CR}" + echo " ${C1}-----------------------------------------------------------------------${CR}" echo " " else if ( $HELPMODE != YES ) then - echo "Enter 2-6 character alphanumeric code (no dashes) to select ${C1}Ocean Resolution ${CR}to be built:" + echo " " + echo "Enter 2-6 character alphanumeric code(s) for ocean horizontal resolution:" + echo "(Separate multiple entries by spaces.)" else - echo "Options for ${C1}Ocean Resolution${CR}:" + echo "Options for ocean horizontal resolution:" endif echo " ${C2}O1 -- Low-Resolution Reynolds 1 deg${CR} (Lon/Lat Data-Ocean: 360x180 )" echo " ${C2}O2 -- Med-Resolution Reynolds 1/4 deg${CR} (Lon/Lat Data-Ocean: 1440x720 )" @@ -275,25 +303,29 @@ else if ( $HELPMODE == YES ) exit ORSLV: + set dummy = `echo $<` + + if (${%dummy} == 0) set dummy = "BLANK" + set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` set orslvs = $dummy[1] + foreach orslv ($dummy) - if( $orslv != 'O1' & \ - $orslv != 'O2' & \ - $orslv != 'O3' & \ - $orslv != 'T2' & \ - $orslv != 'T3' & \ - $orslv != 'T4' & \ - $orslv != 'T1MOM6' & \ - $orslv != 'T2MOM6' & \ - $orslv != 'T4MOM6' & \ - $orslv != 'CS') then - echo " " - echo " ${C1} Invalid choice, try again:${CR}" - goto ORSLV - endif - if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` + if( $orslv != 'O1' & \ + $orslv != 'O2' & \ + $orslv != 'O3' & \ + $orslv != 'T2' & \ + $orslv != 'T3' & \ + $orslv != 'T4' & \ + $orslv != 'T1MOM6' & \ + $orslv != 'T2MOM6' & \ + $orslv != 'T4MOM6' & \ + $orslv != 'CS') then + echo " ${C1} Invalid choice, try again:${CR}" + goto ORSLV + endif + if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` end endif @@ -301,9 +333,10 @@ endif ####################################################################### echo "" -echo "${C1} Atmospheric Code:${CR} ${C2}$HRCODES${CR}" -echo "${C1} Ocean Resolution:${CR} ${C2}$orslvs${CR}" -echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" +echo "${C1} Experiment directory:${CR} ${C2}$EXPDIR${CR}" +echo "${C1} Atmospheric resolution:${CR} ${C2}$HRCODES${CR}" +echo "${C1} Ocean resolution:${CR} ${C2}$orslvs${CR}" +echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" ####################################################################### ####################################################################### @@ -593,10 +626,10 @@ if( $HRCODE == m25 ) then set grid = ease set MGRID = M25 endif - if( $MASKFILE == GEOS5_10arcsec_mask_freshwater-lakes.nc | $MASKFILE == GEOS5_10arcsec_mask.nc ) then - @ NX = 43200 - @ NY = 21600 - endif +if( $MASKFILE == GEOS5_10arcsec_mask_freshwater-lakes.nc | $MASKFILE == GEOS5_10arcsec_mask.nc ) then + @ NX = 43200 + @ NY = 21600 +endif set OUTDIR = `date +'%Y%m%d%H%M%S'` From d6179f9a1528a5c7dcb59d78342c3a34ee6e0ce6 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Thu, 3 Feb 2022 18:40:43 -0500 Subject: [PATCH 32/38] changed order of interactive questions; added BCs version to default output path --- .../Utils/Raster/make_bcs | 160 +++++++++--------- 1 file changed, 81 insertions(+), 79 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs index dfc462c37..20171d2e6 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -22,11 +22,11 @@ if ( $HELPMODE == YES ) then echo " STEP 3: source g5_modules (for bash or zsh use g5_modules.[z]sh) " echo " STEP 4: ./make_bcs " echo " Answer the following interactive questions: " - echo " a) Enter BCs output directory. " - echo " b) Select atmospheric horizontal resolution(s). " - echo " c) Select Land BCs version. " - echo " d) Select ocean resolution(s). " + echo " a) Select Land BCs version. " + echo " b) Select atmospheric resolution(s). " + echo " c) Select ocean resolution(s). " echo " (Not relevant for land-only EASE-grid BCs.) " + echo " d) Enter BCs output directory. " echo " e) Enter sponsor code for computing account. " echo " " echo " To skip the generation of land parameter files (ie, mkCatchParam.x), " @@ -84,29 +84,62 @@ set C1 = $RED set C2 = $BLUE set CR = $RESET -echo "${CR}" - ####################################################################### +# +# Land bcs version (LBCSV) -# Experiment directory (for BCS output) - -# define default -setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE +# set default land bcs version +set lbcsv = NL3 if ( $HELPMODE != YES ) then - + echo "${CR}" + echo "Boundary Conditions (BCs) Package:" echo " " - echo "Enter desired BCS output directory (incl. full path)" - echo " or press ENTER to use the default:" - echo " [${C2}${EXPDIR}${CR}]" - set NEWEXPDIR = $< + echo "Enter 3-character alphanumeric code for land BCs version (select only one):" +else + echo "Options for land BCs version:" +endif +echo " ${C2}F25 : Fortuna-2_5" +echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" +echo " ${C2}ICA : Icarus (/discover/nobackup/ltakacs/bcs/Icarus/)" +echo " ${C2}NL3 : Icarus-NLv3 (/discover/nobackup/ltakacs/bcs/Icarus-NLv3/)" +echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_NLv4/NLv4/)" +echo " ${C2}NL5 : NLv5 [SMAP]" +echo " ${C2}DEV : Development version${CR}" +echo " " +if ( $HELPMODE != YES ) then + echo " NOTE: Due to compiler differences, code improvements and bug fixes that" + echo " have taken place since the above archived BCs were created, some parameter" + echo " files produced by current source code may differ from those in the archived BCs." + echo " Nevertheless, the impact of these differences on science is insignificant and" + echo " the parameter files produced by current source code is considered to be" + echo " scientifically equivalent to the corresponding archived BCs" + echo " " + echo " OR press ENTER to select $lbcsv (current default).${CR}" + echo " " +endif - if( $NEWEXPDIR != '' ) setenv EXPDIR $NEWEXPDIR +LBCSV: +if ( $HELPMODE != YES ) then - mkdir -p $EXPDIR - if ($status>0) then - echo "mkdir ERROR! Exiting..." - exit + set dummy = `echo $<` + + set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` + + if( $dummy == 'F25' | \ + $dummy == 'GM4' | \ + $dummy == 'ICA' | \ + $dummy == 'NL3' | \ + $dummy == 'NL4' | \ + $dummy == 'NL5' | \ + $dummy == 'DEV') then + set lbcsv = $dummy + else if ( $dummy == '' ) then + echo $lbcsv + else + echo " " + echo " ${C1} Invalid choice, try again:${CR}" + goto LBCSV endif endif @@ -209,63 +242,6 @@ else endif -####################################################################### -# -# Land bcs version (LBCSV) - -# set default land bcs version - -set lbcsv = NL3 -if ( $HELPMODE != YES ) then - echo " " - echo "Enter 3-character alphanumeric code for land BCs version (select only one):" -else - echo "Options for land BCs version:" -endif -echo " ${C2}F25 : Fortuna-2_5" -echo " ${C2}GM4 : Ganymed-4_0 (/discover/nobackup/ltakacs/bcs/Ganymed-4_0/)" -echo " ${C2}ICA : Icarus (/discover/nobackup/ltakacs/bcs/Icarus/)" -echo " ${C2}NL3 : Icarus-NLv3 (/discover/nobackup/ltakacs/bcs/Icarus-NLv3/)" -echo " ${C2}NL4 : NLv4 [SMAP] (/discover/nobackup/projects/gmao/smap/bcs_NLv4/NLv4/)" -echo " ${C2}NL5 : NLv5 [SMAP]" -echo " ${C2}DEV : Development version${CR}" -echo " " -if ( $HELPMODE != YES ) then - echo " NOTE: Due to compiler differences, code improvements and bug fixes that" - echo " have taken place since the above archived BCs were created, some parameter" - echo " files produced by current source code may differ from those in the archived BCs." - echo " Nevertheless, the impact of these differences on science is insignificant and" - echo " the parameter files produced by current source code is considered to be" - echo " scientifically equivalent to the corresponding archived BCs" - echo " " - echo " OR press ENTER to select $lbcsv (current default).${CR}" - echo " " -endif - -LBCSV: -if ( $HELPMODE != YES ) then - - set dummy = `echo $<` - - set dummy = `echo $dummy | tr "[:lower:]" "[:upper:]"` - - if( $dummy == 'F25' | \ - $dummy == 'GM4' | \ - $dummy == 'ICA' | \ - $dummy == 'NL3' | \ - $dummy == 'NL4' | \ - $dummy == 'NL5' | \ - $dummy == 'DEV') then - set lbcsv = $dummy - else if ( $dummy == '' ) then - echo $lbcsv - else - echo " " - echo " ${C1} Invalid choice, try again:${CR}" - goto LBCSV - endif -endif - ####################################################################### # # Ocean Horizontal Resolution (ORSLV) @@ -330,13 +306,39 @@ ORSLV: endif + +####################################################################### +# +# Experiment directory (for BCS output) + +# define default +setenv EXPDIR /discover/nobackup/$USER/BCS_PACKAGE/$lbcsv/ + +if ( $HELPMODE != YES ) then + + echo " " + echo "Enter desired BCS output directory (incl. full path)" + echo " or press ENTER to use the default:" + echo " [${C2}${EXPDIR}${CR}]" + set NEWEXPDIR = $< + + if( $NEWEXPDIR != '' ) setenv EXPDIR $NEWEXPDIR + + mkdir -p $EXPDIR + if ($status>0) then + echo "mkdir ERROR! Exiting..." + exit + endif +endif + + ####################################################################### echo "" -echo "${C1} Experiment directory:${CR} ${C2}$EXPDIR${CR}" +echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" echo "${C1} Atmospheric resolution:${CR} ${C2}$HRCODES${CR}" echo "${C1} Ocean resolution:${CR} ${C2}$orslvs${CR}" -echo "${C1} Land BCs version:${CR} ${C2}$lbcsv${CR}" +echo "${C1} Experiment directory:${CR} ${C2}$EXPDIR${CR}" ####################################################################### ####################################################################### From 6c670ee08674514c4b47d2710f8aff44dcd26a29 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Wed, 9 Feb 2022 13:23:55 -0500 Subject: [PATCH 33/38] confirming file formats --- .../Utils/Raster/create_README.csh | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index aedb53fd4..34e49f15d 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -566,7 +566,7 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... file name: ../til/${gfile}.til The 8-line header is followed by ${NGLOBAL} number of rows. do n = 1,${NGLOBAL} - read (10,*)type,`echo "${sec2_til}"` + write (lun,*)type,`echo "${sec2_til}"` end do where for each tile: @@ -580,9 +580,9 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... `echo "${sec2_til2}"` 2.2.2 Western, eastern, southern, northern edges and mean elevation of tiles file name: catchment.def - read (10,*) NTILES + write (lun,*) NTILES do n = 1, ${NTILES} - read (10,'(i10,i8,5(2x,f9.4))') tile_index,pfaf_code, & + write (lun,'(i10,i8,5(2x,f9.4))') tile_index,pfaf_code, & min_lon,max_lon,min_lat,max_lat, mean_elevation (m) end do @@ -598,9 +598,9 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... 2.2.3 Tile topography - statistics of Compound Topographic Index (CTI) file name: cti_stats.dat - read (10,*) NTILES + write (lun,*) NTILES do n = 1, ${NTILES} - read (10,'(i10,i8,5(1x,f8.4))') tile_index,pfaf_code, & + write (lun,'(i10,i8,5(1x,f8.4))') tile_index,pfaf_code, & cti_mean, cti_std, cti_min, cti_max, cti_skew enddo @@ -622,7 +622,7 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... _EOI_ if( $mysoil == HWSD ) then cat << _EOS1_ > clsm/soil - read (10,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.4,3f7.3,4f7.3,2f10.4, f8.4)') & + write (lun,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.4,3f7.3,4f7.3,2f10.4, f8.4)') & tile_index,pfaf_code,soil_class_top,soil_class_com,BEE, & PSIS,POROS,COND, WPWET, DP2BR, gravel,OrgCarbon_top, & OrgCarbon_rz,sand_top,clay_top,sand_rz,clay_rz,WPWET_top, POROS_top, PMAP @@ -946,7 +946,7 @@ cat << _EOS1_ > clsm/soil _EOS1_ else cat << _EOS2_ > clsm/soil - read (10,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.4)') & + write (lun,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.3)') & tile_index,pfaf_code,soil_class_top, & soil_class_com,BEE, PSIS,POROS,COND, & WPWET,soildepth @@ -1017,7 +1017,7 @@ cat << _EOV1_ > clsm/veg1 3.2.1 Mosaic vegetation types and fractions file name: mosaic_veg_typs_fracs do n = 1, ${NTILES} - read (10,*)tile_index,pfaf_code, & + write (lun,(i10,i8,2(2x,i3),2(2x,f6.2),2x,f6.3,2x,f10.7))tile_index,pfaf_code, & primary_veg_type,secondary_veg_type, primary_veg_frac, & secondary_veg_frac, canopy_height, ASCATZ0 end do @@ -1051,7 +1051,7 @@ cat << _EOV2_ > clsm/veg2 3.2.3 CLM/CLM4.5, CLM/CLM4.5-carbon, CLM4.5 and CLM4.5-carbon vegetation types and fractions file names: CLM_veg_typs_fracs and CLM4.5_veg_typs_fracs do n = 1, ${NTILES} - read (10,'(2I10,4I3,4f7.2,2I3,2f7.2)') & + write (lun,'(2I10,4I3,4f7.2,2I3,2f7.2)') & tile_index,pfaf_code, & CLM-C_pt1,CLM-C_pt2,CLM-C_st1,CLM-C_st2, & CLM-C_pf1,CLM-C_pf2,CLM-C_sf1,CLM-C_sf2, & @@ -1126,7 +1126,7 @@ cat << _EOV2_ > clsm/veg2 3.2.4 Nitrogen Deposition, annual mean 2m Tair, soil back gorund albedo file name: CLM_Ndep_SoilAlb do n = 1, ${NTILES} - read (10, '(f10.4,4f7.4,2f8.3)') & + write (lun, '(f10.4,4f7.4,2f8.3)') & NDEP,BGALBVR, BGALBVF, BGALBNR, BGALBNF, T2_M, T2_S enddo @@ -1151,7 +1151,7 @@ cat << _EOV2_ > clsm/veg2 population density (HDM) file name: CLM4.5_abm_peatf_gdp_hdm_fc do n = 1, ${NTILES} - read (10,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)') & + write (lun,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)') & TID, CID, ABM, PEATF, GDP, HDM, FC end do @@ -1175,9 +1175,9 @@ cat << _EOV2_ > clsm/veg2 `echo "${GSWP2_DATES}"` Loop below through until the last data record: - read (10) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + write (lun) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read(10) (data(n),n=1,${NTILES}) + write(lun) (data(n),n=1,${NTILES}) _EOV2_ endif @@ -1364,7 +1364,7 @@ cat << _EOF0_ > clsm/README1 surfexec and rzexec file name : tau_param.dat do n = 1, ${NTILES} - read (10,'(i10,i8,4f10.7)') & + write (lun,'(i10,i8,4f10.7)') & tile_index,pfaf_code,atau2,btau2,atau5,btau5 end do where: @@ -1377,7 +1377,7 @@ cat << _EOF0_ > clsm/README1 root zone and water table file name : ts.dat do n = 1, ${NTILES} - read (10,'(i10,i8,f5.2,4(2x,e13.7))')tile_index,pfaf_code,gnu, & + write (lun,'(i10,i8,f5.2,4(2x,e13.7))')tile_index,pfaf_code,gnu, & tsa1,tsa2,tsb1,tsb2 end do @@ -1390,7 +1390,7 @@ cat << _EOF0_ > clsm/README1 6.2.3 Baseflow parameters file name : bf.dat do n = 1, ${NTILES} - read (10,'(i10,i8,f5.2,3(2x,e13.7))')tile_index,pfaf_code,gnu,bf1,bf2,bf3 + write (lun,'(i10,i8,f5.2,3(2x,e13.7))')tile_index,pfaf_code,gnu,bf1,bf2,bf3 end do where: @@ -1402,7 +1402,7 @@ cat << _EOF0_ > clsm/README1 6.2.4 Area fractioning parameters file name : ar.new do n = 1, ${NTILES} - read (10,'(i10,i8,f5.2,11(2x,e13.7))')tile_index,pfaf_code,gnu, & + write (lun,'(i10,i8,f5.2,11(2x,e14.7))')tile_index,pfaf_code,gnu, & ars1,ars2,ars3,ara1,ara2,ara3,ara4,arw1,arw2,arw3,arw4 end do @@ -1498,9 +1498,9 @@ cat << _EOF1_ > clsm/README2 7.2.1 Pafafstetter catchment connectivity, channel information file name : /discover/nobackup/projects/gmao/ssd/land/l_data/LandBCs_files_for_mkCatchParam/V001/ SRTM-TopoData/Pfafcatch-routing.dat - read (10,*) NPfafs + write (lun,*) NPfafs do n = 1, ${NPfafs} - read (10,'(i8,i15,4(1x,f9.4),1x,e10.3,3(1x,e9.3),I8,6(1x,f9.4))') & + write (lun,'(i8,i15,4(1x,f9.4),1x,e10.3,4(1x,e9.3),I8,6(1x,f9.4))') & pfaf_index,pfaf_code,min_lon,max_lon,min_lat,max_lat, mean_elevation, & cat_area,cum_area, length,ElevDiff, dnst_pfaf_index,DN_long, DN_lat, & UP_lon, UP_lat, mouth_lon, mouth_lat @@ -1554,7 +1554,7 @@ cat << _EOF2_ > clsm/README3 file name : country_and_state_code.data do n = 1, ${NTILES} - read (10,'(i10, 2I4, 1x, a48, a20)') & + write (lun,'(i10, 2I4, 1x, a48, a20)') & tile_index, cnt_code, st_code, CNT_NAME, ST_NAME 8.3 References https://gadm.org From f3ffc7b283c8c9455130c6244d710c37447fcbbc Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Wed, 9 Feb 2022 14:54:09 -0500 Subject: [PATCH 34/38] last two colums are marked as dummies. Usage unknown --- .../GEOSsurface_GridComp/Utils/Raster/create_README.csh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 34e49f15d..159e4ab75 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -600,8 +600,8 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... file name: cti_stats.dat write (lun,*) NTILES do n = 1, ${NTILES} - write (lun,'(i10,i8,5(1x,f8.4))') tile_index,pfaf_code, & - cti_mean, cti_std, cti_min, cti_max, cti_skew + write (lun,'i10,i8,5(1x,f8.4),i5,e18.3)') tile_index,pfaf_code, & + cti_mean, cti_std, cti_min, cti_max, cti_skew, dummy, dummy enddo where for each tile: From 10d86c2b71340b7237a3ee4f1991f330afcdde03 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Wed, 9 Feb 2022 15:14:23 -0500 Subject: [PATCH 35/38] some cleanup of create_README.sh --- .../Utils/Raster/create_README.csh | 279 +++++++++--------- 1 file changed, 140 insertions(+), 139 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 159e4ab75..fcd9f6289 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -354,59 +354,55 @@ set mysoil=`head -5 clsm/mkCatchParam.log | tail -1` cat << _EOI_ > clsm/intro ===================================================================================== -|| || -|| Land Boundary Conditions for the || -|| || -|| Goddard Earth Observing System Model Version 5 (GEOS-5) || -|| || + + Land Boundary Conditions for the + + Goddard Earth Observing System Model Version 5 (GEOS-5) + ${mygrid} Grid -|| || -|| ---------------------- || -|| || -|| Data File Descriptions || -|| || -|| || -|| || -|| || -|| || -|| _______________________________________________________________________________ || -|| || -|| Global Modeling and Assimilation Office || -|| 610.1 NASA/GSFC || -|| || -|| || -|| Author : Sarith Mahanama (sarith.p.mahanama@nasa.gov) || -|| || -|| Data Citation : Mahanama, S.P., R.D. Koster, G.K. Walker, L. Takacs, R.H. || -|| Reichle, G. de Lannoy, Q. Liu, B. Zhao, and M. Suarez (2015) : || -|| Land Boundary Conditions for the Goddard Earth Observing System || -|| Model Version 5 (GEOS-5) Climate Modeling System - Recent || -|| Updates and Data File Descriptions. NASA Technical Report Series|| -|| on Global Modeling and Data Assimilation 104606, v39, 51pp. || -|| URL: http://gmao.gsfc.nasa.gov/pubs/tm/ || -|| || -|| IMPORTANT UPDATE (5/4/2019) : || -|| In addition to the ASCII files mentioned in the text, following || -|| two nc4 files also contain parameters that are needed by models. || -|| More importantly, the restart utilities read parameters || -|| from below 2 nc4 files instead the ASCII files. || -|| || -|| (1) "catch_params.nc4" contains : || -|| OLD_ITY (primary vegetation type Section 3.2.1) || -|| BEE, PSIS, POROS, COND, WPWET, DP2BR (Section 2.2.4) || -|| ATAU2,BTAU2,ATAU5,BTAU5 (Section 6.2.1) || -|| GNU, TSA1,TSA2,TSB1,TSB2 (Section 6.2.2) || -|| BF1,BF2,BF3 (Section 6.2.3) || -|| ARS1,ARS2,ARS3,ARA1,ARA2,ARA3,ARA4,ARW1,ARW2, || -|| ARW3,ARW4 (Section 6.2.4) || -|| || -|| (1) "catchcn_params.nc4" contains : || -|| ITY (CLM-C_pt1, CLM-C_pt2, CLM-C_st1, CLM-C_st2 Section 3.3.3) || -|| FVG (CLM-C_pf1, CLM-C_pf2,CLM-C_sf1, CLM-C_sf2 Section 3.3.3) || -|| NDEP,BGALBVR, BGALBVF, BGALBNR, BGALBNF, T2_M, T2_S (Section 3.2.4)|| -|| || -|| Date : ${today} || -|| || + + ---------------------- + + Data File Descriptions + + _______________________________________________________________________________ + + Global Modeling and Assimilation Office + 610.1 NASA/GSFC + + + Author : Sarith Mahanama (sarith.p.mahanama@nasa.gov) + + Data Citation : Mahanama, S.P., R.D. Koster, G.K. Walker, L. Takacs, R.H. + Reichle, G. de Lannoy, Q. Liu, B. Zhao, and M. Suarez (2015) : + Land Boundary Conditions for the Goddard Earth Observing System + Model Version 5 (GEOS-5) Climate Modeling System - Recent + Updates and Data File Descriptions. NASA Technical Report Series + on Global Modeling and Data Assimilation 104606, v39, 51pp. + URL: http://gmao.gsfc.nasa.gov/pubs/ + + IMPORTANT UPDATE (5/4/2019) : + In addition to the ASCII files mentioned in the text, the following two nc4 + files also contain the parameters that are needed by the land models. + The restart utilities now read parameters from these nc4 files rather than + from the ASCII files. + + (1) "catch_params.nc4" contains: + OLD_ITY (Section 3.2.1) + BEE, PSIS, POROS, COND, WPWET, DP2BR (Section 2.2.4) + ATAU2, BTAU2, ATAU5, BTAU5 (Section 6.2.1) + GNU, TSA1, TSA2, TSB1, TSB2 (Section 6.2.2) + BF1, BF2, BF3 (Section 6.2.3) + ARS1, ARS2, ARS3, ARA1, ARA2, ARA3, ARA4, ARW1, ARW2, + ARW3, ARW4 (Section 6.2.4) + + (2) "catchcn_params.nc4" contains: + ITY (CLM-C_pt1, CLM-C_pt2, CLM-C_st1, CLM-C_st2) (Section 3.3.3) + FVG (CLM-C_pf1, CLM-C_pf2, CLM-C_sf1, CLM-C_sf2) (Section 3.3.3) + NDEP, BGALBVR, BGALBVF, BGALBNR, BGALBNF, T2_M, T2_S (Section 3.2.4) + + Date : ${today} + ===================================================================================== TABLE OF CONTENTS @@ -465,10 +461,10 @@ cat << _EOI_ > clsm/intro 8.2.1 Country Code, US State Code, Country Name, State Name 8.3 References -APPENDIX I - mkCatchParam tag, input options, and log ............................ A1 +APPENDIX I - mkCatchParam tag, input options, and log ........................... A-I ===================================================================================== -====================================== PAGE 1 ====================================== +=================================== SECTION 1 ====================================== ===================================================================================== 1. INTRODUCTION @@ -476,9 +472,9 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... This directory contains land boundary data files that are needed by the land models in the GEOS-5 climate modeling system. The catchment-tiles (computational units at the land surface) have been derived for the GEOS5 ${mygrid} grid - `echo "$int_str1"` The ${mygrid} - grid comprises of ${NGLOBAL} number of tiles globally, out of which ${NTILES} are - catchment-tiles. + `echo "$int_str1"` + The ${mygrid} grid comprises ${NGLOBAL} tiles globally, of which ${NTILES} + are catchment-tiles. An ${NC}x${NR} integer array of tile indices is saved in Fortran binary file "../rst/${gfile}.rst" in little-endian format. @@ -493,7 +489,7 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... of seasonal variables are available in "plots" directory. ===================================================================================== -====================================== PAGE 2 ====================================== +=================================== SECTION 2 ====================================== ===================================================================================== 2. TOPOGRAPHY AND SOIL DATA @@ -566,7 +562,7 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... file name: ../til/${gfile}.til The 8-line header is followed by ${NGLOBAL} number of rows. do n = 1,${NGLOBAL} - write (lun,*)type,`echo "${sec2_til}"` + read ([UNIT],*) type,`echo "${sec2_til}"` end do where for each tile: @@ -580,10 +576,10 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... `echo "${sec2_til2}"` 2.2.2 Western, eastern, southern, northern edges and mean elevation of tiles file name: catchment.def - write (lun,*) NTILES + read ([UNIT],*) NTILES do n = 1, ${NTILES} - write (lun,'(i10,i8,5(2x,f9.4))') tile_index,pfaf_code, & - min_lon,max_lon,min_lat,max_lat, mean_elevation (m) + read ([UNIT],'(i10,i8,5(2x,f9.4))') tile_index, pfaf_code, & + min_lon, max_lon,min_lat, max_lat, mean_elevation end do where for each tile: @@ -598,10 +594,10 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... 2.2.3 Tile topography - statistics of Compound Topographic Index (CTI) file name: cti_stats.dat - write (lun,*) NTILES + read ([UNIT],*) NTILES do n = 1, ${NTILES} - write (lun,'i10,i8,5(1x,f8.4),i5,e18.3)') tile_index,pfaf_code, & - cti_mean, cti_std, cti_min, cti_max, cti_skew, dummy, dummy + read ([UNIT],'(i10,i8,5(1x,f8.4),i5,e18.3)') tile_index, pfaf_code, & + cti_mean, cti_std, cti_min, cti_max, cti_skew, dummy, dummy enddo where for each tile: @@ -622,10 +618,10 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... _EOI_ if( $mysoil == HWSD ) then cat << _EOS1_ > clsm/soil - write (lun,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.4,3f7.3,4f7.3,2f10.4, f8.4)') & - tile_index,pfaf_code,soil_class_top,soil_class_com,BEE, & - PSIS,POROS,COND, WPWET, DP2BR, gravel,OrgCarbon_top, & - OrgCarbon_rz,sand_top,clay_top,sand_rz,clay_rz,WPWET_top, POROS_top, PMAP + read ([UNIT],'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.4,3f7.3,4f7.3,2f10.4, f8.4)') & + tile_index, pfaf_code, soil_class_top, soil_class_com, BEE, & + PSIS, POROS, COND, WPWET, DP2BR, gravel, OrgCarbon_top, & + OrgCarbon_rz, sand_top, clay_top, sand_rz, clay_rz, WPWET_top, POROS_top, PMAP end do where for each tile: @@ -946,10 +942,10 @@ cat << _EOS1_ > clsm/soil _EOS1_ else cat << _EOS2_ > clsm/soil - write (lun,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.3)') & - tile_index,pfaf_code,soil_class_top, & - soil_class_com,BEE, PSIS,POROS,COND, & - WPWET,soildepth + read ([UNIT],'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.3)') & + tile_index, pfaf_code, soil_class_top, & + soil_class_com,BEE, PSIS, POROS, COND, & + WPWET, soildepth end do where for each tile: @@ -985,7 +981,7 @@ cat << _EOV1_ > clsm/veg1 610.1 NASA/GSFC. ===================================================================================== -====================================== PAGE 3 ====================================== +=================================== SECTION 3 ====================================== ===================================================================================== 3. VEGETATION CLASSIFICATION DATA @@ -1017,9 +1013,9 @@ cat << _EOV1_ > clsm/veg1 3.2.1 Mosaic vegetation types and fractions file name: mosaic_veg_typs_fracs do n = 1, ${NTILES} - write (lun,(i10,i8,2(2x,i3),2(2x,f6.2),2x,f6.3,2x,f10.7))tile_index,pfaf_code, & - primary_veg_type,secondary_veg_type, primary_veg_frac, & - secondary_veg_frac, canopy_height, ASCATZ0 + read ([UNIT],(i10,i8,2(2x,i3),2(2x,f6.2),2x,f6.3,2x,f10.7)) tile_index, pfaf_code, & + primary_veg_type, secondary_veg_type, primary_veg_frac, & + secondary_veg_frac, canopy_height, ASCATZ0 end do where for each tile: @@ -1040,9 +1036,9 @@ cat << _EOV1_ > clsm/veg1 3.2.2 vegdyn input data (mosaic primary type, canopy height, and roughness) for GEOS5 . file name: vegdyn.data or ../vegdyn_*.dat file format: fortran binaries, little_endian - read(10) (primary_veg_type(n),n=1,${NTILES}) - read(10) (canopy_height (n),n=1,${NTILES}) - read(10) (ASCATz0 (n),n=1,${NTILES}) + read ([UNIT]) (primary_veg_type(n),n=1,${NTILES}) + read ([UNIT]) (canopy_height (n),n=1,${NTILES}) + read ([UNIT]) (ASCATz0 (n),n=1,${NTILES}) _EOV1_ if( $MYMASK == GEOS5_10arcsec_mask | $MYMASK == GEOS5_10arcsec_mask.nc | $MYMASK == GEOS5_10arcsec_mask_freshwater-lakes.nc ) then @@ -1051,11 +1047,11 @@ cat << _EOV2_ > clsm/veg2 3.2.3 CLM/CLM4.5, CLM/CLM4.5-carbon, CLM4.5 and CLM4.5-carbon vegetation types and fractions file names: CLM_veg_typs_fracs and CLM4.5_veg_typs_fracs do n = 1, ${NTILES} - write (lun,'(2I10,4I3,4f7.2,2I3,2f7.2)') & - tile_index,pfaf_code, & - CLM-C_pt1,CLM-C_pt2,CLM-C_st1,CLM-C_st2, & - CLM-C_pf1,CLM-C_pf2,CLM-C_sf1,CLM-C_sf2, & - CLM_pt, CLM_st, CLM_pf, CLM_sf + read ([UNIT],'(2I10,4I3,4f7.2,2I3,2f7.2)') & + tile_index, pfaf_code, & + CLM-C_pt1, CLM-C_pt2, CLM-C_st1, CLM-C_st2, & + CLM-C_pf1, CLM-C_pf2, CLM-C_sf1, CLM-C_sf2, & + CLM_pt, CLM_st, CLM_pf, CLM_sf enddo where for each tile: @@ -1126,8 +1122,8 @@ cat << _EOV2_ > clsm/veg2 3.2.4 Nitrogen Deposition, annual mean 2m Tair, soil back gorund albedo file name: CLM_Ndep_SoilAlb do n = 1, ${NTILES} - write (lun, '(f10.4,4f7.4,2f8.3)') & - NDEP,BGALBVR, BGALBVF, BGALBNR, BGALBNF, T2_M, T2_S + read ([UNIT], '(f10.4,4f7.4,2f8.3)') & + NDEP, BGALBVR, BGALBVF, BGALBNR, BGALBNF, T2_M, T2_S enddo Where for each tile: @@ -1151,8 +1147,8 @@ cat << _EOV2_ > clsm/veg2 population density (HDM) file name: CLM4.5_abm_peatf_gdp_hdm_fc do n = 1, ${NTILES} - write (lun,'(2I10, i3, f8.4, f8.2, f10.2, f8.4)') & - TID, CID, ABM, PEATF, GDP, HDM, FC + read ([UNIT],'(2I10, i3, f8.4, f8.2, f10.2, f8.4)') & + TID, CID, ABM, PEATF, GDP, HDM, FC end do where for each tile: @@ -1192,7 +1188,7 @@ cat << _EOF0_ > clsm/README1 `echo "${sec3_veg_cite}"` ===================================================================================== -====================================== PAGE 4 ====================================== +=================================== SECTION 4 ====================================== ===================================================================================== 4. VEGETATION DYNAMIC DATA @@ -1201,13 +1197,13 @@ cat << _EOF0_ > clsm/README1 `echo "${sec4_lai}"` - The AVHRR NDVI3g data [third generation Global Inventory Modeling and Mapping Studies - (GIMMS) Normalizeed difference vegetation index (NDVI) data derived from AVHRR images)] - are available two times per month for a 35 year period spanning from 1981 to 2015 at - 5-arcmin resolution (Pinzon et al., 2014). A NDVI climatology data set for the same - temporal resolution was constructed by temporally averaging over the 35-year period - on the 5×5 arcmin grid and then aggregating over the pixels of each land element to - derive NDVI climatology for that land element. + The AVHRR NDVI3g data [third generation Global Inventory Modeling and Mapping Studies + (GIMMS) Normalizeed difference vegetation index (NDVI) data derived from AVHRR images)] + are available two times per month for a 35 year period spanning from 1981 to 2015 at + 5-arcmin resolution (Pinzon et al., 2014). A NDVI climatology data set for the same + temporal resolution was constructed by temporally averaging over the 35-year period + on the 5×5 arcmin grid and then aggregating over the pixels of each land element to + derive NDVI climatology for that land element. 4.2 Data files and movies 4.2.1 Greenness Fraction [-] - [Movie 1 : "plots/GREEN.mp4"] @@ -1219,10 +1215,11 @@ cat << _EOF0_ > clsm/README1 data records are given below: `echo "${GSWP2_DATES}"` - Loop below through until the last data record: - read(10) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, - Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read(10) (data(n),n=1,${NTILES}) + do ii=1,N_avgperiod + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + Year_End, Month_End, Day_End, Hour_End, Minute_End, Secs_End (Float Numbers) + read ([UNIT]) (data(n),n=1,${NTILES}) + end do 4.2.2 Leaf Area Index (LAI) [m2/m2] - [Movie 2:"plots/LAI.mp4"; Figure 13: "plots/lai.jpg"] file name : lai.dat (or ../lai_clim*.data) @@ -1233,10 +1230,11 @@ cat << _EOF0_ > clsm/README1 data records are given below: `echo "${MYLAIDATES}"` - Loop below through until the last data record: - read(10) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, - Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read(10) (data(n),n=1,${NTILES}) + do ii=1,N_avgperiod + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + Year_End, Month_End, Day_End, Hour_End, Minute_End, Secs_End (Float Numbers) + read ([UNIT]) (data(n),n=1,${NTILES}) + end do 4.2.3 Normalized Difference Vegetation Index (NDVI) [-] file name : ndvi.dat (or ../ndvi_clim*.data) @@ -1247,11 +1245,12 @@ cat << _EOF0_ > clsm/README1 data records are given below: `echo "${NDVI_DATES}"` - Loop below through until the last data record: - read(10) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, - Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read(10) (data(n),n=1,${NTILES}) - + do ii=1,N_avgperiod + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + Year_End, Month_End, Day_End, Hour_End, Minute_End, Secs_End (Float Numbers) + read ([UNIT]) (data(n),n=1,${NTILES}) + end do + 4.3 References Dirmeyer, P. and Oki, T. (2002): The Second Global Soil Wetness project (GSWP-2) Science 2 and Implementation Plan. IGPO Publication Series No. 37, 64p. @@ -1260,7 +1259,7 @@ cat << _EOF0_ > clsm/README1 `echo "${sec4_geo_cite}"` ===================================================================================== -====================================== PAGE 5 ====================================== +=================================== SECTION 5 ====================================== ===================================================================================== 5. SURFACE ALBEDO DATA @@ -1305,11 +1304,12 @@ cat << _EOF0_ > clsm/README1 data records are given below (MMDD): `echo "${MYALBDATES}"` - Loop below through until the last data record: - read(10) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, - Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read(10) (data(n),n=1,${NTILES}) - + do ii=1,N_avgperiod + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + Year_End, Month_End, Day_End, Hour_End, Minute_End, Secs_End (Float Numbers) + read ([UNIT]) (data(n),n=1,${NTILES}) + end do + 5.2.2 MODIS Scale Parameters [Diffused, Visible (0.3_0.7) and Near-Infrared (0.7_5.0)] file names : visdf.dat/nirdf.dat (or ../visdf*dat and ../nirdf*dat) file format: fortran binaries, little_endian @@ -1319,11 +1319,12 @@ cat << _EOF0_ > clsm/README1 data records are given below: `echo "${MYALBDATES}"` - Loop below through until the last data record: - read(10) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, - Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read(10) (data(n),n=1,${NTILES}) - + do ii=1,N_avgperiod + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + Year_End, Month_End, Day_End, Hour_End, Minute_End, Secs_End (Float Numbers) + read ([UNIT]) (data(n),n=1,${NTILES}) + end do + 5.3 References Gao, F., He, T., Wang, Z., Ghimire, B., Shuai, Y., Masek, J., Schaaf, C. and Williams, C. (2014): Multiscale climatological albedo look-up maps derived @@ -1338,7 +1339,7 @@ cat << _EOF0_ > clsm/README1 model (SiB) for use within general circulation models, J. Atmos. Sci., 43, 505-531. ===================================================================================== -====================================== PAGE 6 ====================================== +=================================== SECTION 6 ====================================== ===================================================================================== 6. CATCHMENT LAND SURFACE MODEL PARAMETES @@ -1364,8 +1365,8 @@ cat << _EOF0_ > clsm/README1 surfexec and rzexec file name : tau_param.dat do n = 1, ${NTILES} - write (lun,'(i10,i8,4f10.7)') & - tile_index,pfaf_code,atau2,btau2,atau5,btau5 + read ([UNIT],'(i10,i8,4f10.7)') & + tile_index, pfaf_code, atau2, btau2, atau5, btau5 end do where: (1) atau2 atau2: Equation (17) for a 2cm surface layer [-] @@ -1377,8 +1378,8 @@ cat << _EOF0_ > clsm/README1 root zone and water table file name : ts.dat do n = 1, ${NTILES} - write (lun,'(i10,i8,f5.2,4(2x,e13.7))')tile_index,pfaf_code,gnu, & - tsa1,tsa2,tsb1,tsb2 + read ([UNIT],'(i10,i8,f5.2,4(2x,e13.7))') tile_index, pfaf_code,gnu, & + tsa1, tsa2, tsb1, tsb2 end do where: @@ -1390,7 +1391,7 @@ cat << _EOF0_ > clsm/README1 6.2.3 Baseflow parameters file name : bf.dat do n = 1, ${NTILES} - write (lun,'(i10,i8,f5.2,3(2x,e13.7))')tile_index,pfaf_code,gnu,bf1,bf2,bf3 + read ([UNIT],'(i10,i8,f5.2,3(2x,e13.7))') tile_index, pfaf_code, gnu, bf1, bf2, bf3 end do where: @@ -1402,8 +1403,8 @@ cat << _EOF0_ > clsm/README1 6.2.4 Area fractioning parameters file name : ar.new do n = 1, ${NTILES} - write (lun,'(i10,i8,f5.2,11(2x,e14.7))')tile_index,pfaf_code,gnu, & - ars1,ars2,ars3,ara1,ara2,ara3,ara4,arw1,arw2,arw3,arw4 + read ([UNIT],'(i10,i8,f5.2,11(2x,e14.7))') tile_index, pfaf_code, gnu, & + ars1, ars2, ars3, ara1, ara2, ara3, ara4, arw1, arw2, arw3, arw4 end do where: @@ -1435,7 +1436,7 @@ if( $MYMASK == GEOS5_10arcsec_mask.nc | $MYMASK == GEOS5_10arcsec_mask | $MYMASK cat << _EOF1_ > clsm/README2 ===================================================================================== -====================================== PAGE 7 ====================================== +=================================== SECTION 7 ====================================== ===================================================================================== 7. GLOBAL RUNOFF ROUTING MODEL DATA @@ -1498,12 +1499,12 @@ cat << _EOF1_ > clsm/README2 7.2.1 Pafafstetter catchment connectivity, channel information file name : /discover/nobackup/projects/gmao/ssd/land/l_data/LandBCs_files_for_mkCatchParam/V001/ SRTM-TopoData/Pfafcatch-routing.dat - write (lun,*) NPfafs + read ([UNIT],*) NPfafs do n = 1, ${NPfafs} - write (lun,'(i8,i15,4(1x,f9.4),1x,e10.3,4(1x,e9.3),I8,6(1x,f9.4))') & - pfaf_index,pfaf_code,min_lon,max_lon,min_lat,max_lat, mean_elevation, & - cat_area,cum_area, length,ElevDiff, dnst_pfaf_index,DN_long, DN_lat, & - UP_lon, UP_lat, mouth_lon, mouth_lat + read ([UNIT],'(i8,i15,4(1x,f9.4),1x,e10.3,4(1x,e9.3),I8,6(1x,f9.4))') & + pfaf_index, pfaf_code, min_lon, max_lon, min_lat, max_lat, mean_elevation, & + cat_area, cum_area, length,ElevDiff, dnst_pfaf_index, DN_long, DN_lat, & + UP_lon, UP_lat, mouth_lon, mouth_lat end do pfaf_index [-] catchment index (1-$NPfafs) after sorting Pfafstetter codes in ascending order @@ -1539,7 +1540,7 @@ endif cat << _EOF2_ > clsm/README3 ===================================================================================== -====================================== PAGE 8 ====================================== +=================================== SECTION 8 ====================================== ===================================================================================== 8. GLOBAL COUNTRY AND US STATE MAPS @@ -1554,13 +1555,13 @@ cat << _EOF2_ > clsm/README3 file name : country_and_state_code.data do n = 1, ${NTILES} - write (lun,'(i10, 2I4, 1x, a48, a20)') & - tile_index, cnt_code, st_code, CNT_NAME, ST_NAME + read ([UNIT],'(i10, 2I4, 1x, a48, a20)') & + tile_index, cnt_code, st_code, CNT_NAME, ST_NAME 8.3 References https://gadm.org ===================================================================================== -====================================== PAGE A1 ====================================== +=================================== SECTION A-I ===================================== ===================================================================================== APPENDIX I - mkCatchParam tag, input options, and log From b38f4ef90f4f56d044439e32e135db0ead395548 Mon Sep 17 00:00:00 2001 From: biljanaorescanin Date: Wed, 9 Feb 2022 20:24:13 -0500 Subject: [PATCH 36/38] more cleanup --- .../GEOSsurface_GridComp/Utils/Raster/create_README.csh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index fcd9f6289..1d0efc632 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -1171,9 +1171,9 @@ cat << _EOV2_ > clsm/veg2 `echo "${GSWP2_DATES}"` Loop below through until the last data record: - write (lun) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - write(lun) (data(n),n=1,${NTILES}) + read ([UNIT]) (data(n),n=1,${NTILES}) _EOV2_ endif From 502a2db6726530b5e48bc443ccfb19ba43c0aa4b Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Wed, 9 Feb 2022 20:41:10 -0500 Subject: [PATCH 37/38] additional cleanup --- .../Utils/Raster/create_README.csh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 1d0efc632..9092cf5a2 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -547,12 +547,12 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... across a given catchment land element to determine that catchment’s effective soil depth. - Sixteen ARC/GIS shapefiles were obtained from Xu et al. (2017). Canada and + For PEATMAP, sixteen ARC/GIS shapefiles were obtained from Xu et al. (2017). Canada and Hokaido-Mongolia-NorthKorea provided peat fractions inside designated polygons. All other regional shape files give exact perimeter of of the peatland. A global 30-arcsec raster array (43200x21600) of peatland fraction was constructed using those 16 shapefiles. Soil types derived on tiles are now further updated using the peatmap data. If the computed - fractional coverage of peatland based on PEATMAP data at a given catchment-tile excceeds 0.3, + fractional coverage of peatland based on PEATMAP data at a given catchment-tile excceeds 0.5(?), we assume the dominant soil type is as peatland. Soil hydraulic parameters for all peatland tiles are now obtained from Bechtold et al. (2019). @@ -1170,10 +1170,11 @@ cat << _EOV2_ > clsm/veg2 data records are given below: `echo "${GSWP2_DATES}"` - Loop below through until the last data record: - read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, - Year_End,Month_End,Day_End,Hour_End,Minute_End,Secs_End (Float Numbers) - read ([UNIT]) (data(n),n=1,${NTILES}) + do ii=1,N_avgperiod + read ([UNIT]) Year_Begin,Month_Begin,Day_Begin,Hour_Begin,Minute_Begin,Secs_Begin, + Year_End, Month_End, Day_End, Hour_End, Minute_End, Secs_End (Float Numbers) + read ([UNIT]) (data(n),n=1,${NTILES}) + end do _EOV2_ endif From 9524b17555085aae7c2c581e4d10438c3633cad9 Mon Sep 17 00:00:00 2001 From: Rolf Reichle Date: Wed, 9 Feb 2022 22:01:38 -0500 Subject: [PATCH 38/38] more cleanup of documentation --- .../Utils/Raster/create_README.csh | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh index 9092cf5a2..88c5384cb 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/create_README.csh @@ -58,7 +58,7 @@ set toc_rout="`printf '\\n7. GLOBAL RUNOFF ROUTING MODEL DATA .................. The Mosaic types used for catchment surface elements are determined by computing\\n \ the dominant Mosaic type of all 10-arcsec pixels within the catchment in question.\\n \ \\n \ - (b) Deriving Catchment-carbon (Catchment-CN) classes:\\n \ + (b) Deriving Catchment-Carbon/Nitrogen (Catchment-CN) classes:\\n \ \\n \ The Common Land Model version 4 (CLM4: Oleson et al., 2010) utilizes 17 vegetation\\n \ classes and the version 4.5 (CLM4.5: Oleson et al., 2013) uses 25 vegetation classes (Table 2).\\n \ @@ -165,7 +165,7 @@ endif # Set AGCM/SMAP specifics ######################### set WGRID=AGCM -set int_str1="`printf 'by overlaying the atmospheric grid on ${NPfafs} number of hydraulic catchments \\n in ${MYMASK} mask file.'`" +set int_str1="`printf 'by overlaying the atmospheric grid on ${NPfafs} hydraulic catchments \\n in the ${MYMASK} mask file.'`" set sec2_til="`printf ' area, longitude, latitude, ig, jg, cell_frac'`" set pfafin_des="`printf 'catchment index (1-$NPfafs) after sorting Pfafstetter codes in ascending order'`" set pfaf_des="`printf 'Pfafstetter code of the hydrologic catchment'`" @@ -239,7 +239,7 @@ if($mylai == GLASSA) then 8-day climatology of LAI was computed from these data by temporally averaging over the 37-year period \\n \ (by 8-day periods) on the 3-arcmin grid. Those climatological data were aggregated over \\n \ the pixels of each land element to derive a 8-day LAI\\n \ - In order to fill gaps that may exist due to inconsistencies between LAI and GEOS5 masks as well as data gaps themselves\\n \ + In order to fill gaps that may exist due to inconsistencies between the LAI and GEOS masks as well as data gaps themselves\\n \ we constructed, at every time slice, a 1°×1° global gridded LAI dataset \\n \ by spatially aggregating the finer resolution LAI climatological data. Missing \\n \ LAI values in the finer resolution datasets were filled with the value for the \\n \ @@ -251,7 +251,7 @@ if($mylai == GLASSM) then 8-day climatology of LAI was computed from these data by temporally averaging over the 18-year period \\n \ (by 8-day periods) on the 3-arcmin grid. Those climatological data were aggregated over \\n \ the pixels of each land element to derive a 8-day LAI\\n \ - In order to fill gaps that may exist due to inconsistencies between LAI and GEOS5 masks as well as data gaps themselves\\n \ + In order to fill gaps that may exist due to inconsistencies between the LAI and GEOS masks as well as data gaps themselves\\n \ we constructed, at every time slice, a 1°×1° global gridded LAI dataset \\n \ by spatially aggregating the finer resolution LAI climatological data. Missing \\n \ LAI values in the finer resolution datasets were filled with the value for the \\n \ @@ -276,7 +276,7 @@ if($mylai == MODIS | $mylai == MODGEO) then Preprocessing of the two datasets showed that each had potential flaws, \\n \ with GEOLAND2 showing questionable seasonal cycles in Siberia, and MODIS \\n \ showing questionable values over the rain forests. We thus decided to \\n \ - produce a merged LAI data product for GEOS5 to avoid these potential \\n \ + produce a merged LAI data product for GEOS to avoid these potential \\n \ deficiencies. \\n \ \\n \ The first step in generating the merged product was computing a 10-day \\n \ @@ -357,7 +357,7 @@ cat << _EOI_ > clsm/intro Land Boundary Conditions for the - Goddard Earth Observing System Model Version 5 (GEOS-5) + Goddard Earth Observing System (GEOS) Model ${mygrid} Grid @@ -423,7 +423,7 @@ cat << _EOI_ > clsm/intro 3.1 Data generation and processing chain 3.2 Data files and images 3.2.1 Mosaic vegetation types and fractions - 3.2.2 vegdyn input data (mosaic primary type, canopy height, and roughness) for GEOS5 + 3.2.2 vegdyn input data (mosaic primary type, canopy height, and roughness) for GEOS 3.2.3 CLM/CLM4.5 and CLM/CLM4.5-carbon vegetation types and fractions 3.2.4 CLM Nitrogen Deposition, annual mean T2m, soil back ground albedo 3.2.5 CLM4.5 ABM, PEATF, GDP, HDM, and soil field capacity @@ -461,7 +461,7 @@ cat << _EOI_ > clsm/intro 8.2.1 Country Code, US State Code, Country Name, State Name 8.3 References -APPENDIX I - mkCatchParam tag, input options, and log ........................... A-I +APPENDIX I - mkCatchParam input options and log ................................. A-I ===================================================================================== =================================== SECTION 1 ====================================== @@ -470,8 +470,8 @@ APPENDIX I - mkCatchParam tag, input options, and log .......................... 1. INTRODUCTION This directory contains land boundary data files that are needed by the land models in - the GEOS-5 climate modeling system. The catchment-tiles (computational units at the - land surface) have been derived for the GEOS5 ${mygrid} grid + the GEOS climate modeling system. The catchment-tiles (computational units at the + land surface) have been derived for the GEOS ${mygrid} grid `echo "$int_str1"` The ${mygrid} grid comprises ${NGLOBAL} tiles globally, of which ${NTILES} are catchment-tiles. @@ -650,7 +650,7 @@ cat << _EOS1_ > clsm/soil (17) clay_rz [w%] percentage clay in the root-zone layer (0-100cm) (18) WPWET_top [-] wilting point/porosity for the surface layer (0-30cm) (19) POROS_top [m3/m3] soil moisture content at saturation in the surface layer (0-30cm) - (20) PMAP the fraction of cell covered bt PEATLAND + (20) PMAP [-] fraction of cell (tile?) covered by peatland ======================================================================== @@ -912,8 +912,8 @@ cat << _EOS1_ > clsm/soil 13.333 3.333 83.333 1.123 2.3751 -1.1086 0.4422 0.0555 0.57369E-06 6.667 6.667 86.667 1.123 2.6893 -1.0407 0.4470 0.0699 0.51317E-06 3.333 3.333 93.333 1.123 2.2797 -1.3816 0.4436 0.0563 0.32091E-06 - PEAT (N/A) >=8.72 3.4130 -1.7600 0.8000 0.2162 0.78600E-06 - PEAT,Bechtold et al. PEATMAP 3.5000 -0.0300 0.9300 0.3672 0.28000E-06 + Peat: HWSD (N/A) (N/A) (N/A) >=8.72 3.4130 -1.7600 0.8000 0.2162 0.78600E-06 +or Peat: PEATMAP (N/A) (N/A) (N/A) 3.5000 -0.0300 0.9300 0.3672 0.28000E-06 (Bechtold et al) ------------------------------------------------------------------------ Table 1: Soil Hydraulic Properties for 253 soil classes (adapted from De @@ -938,7 +938,6 @@ cat << _EOS1_ > clsm/soil T. M. Munir, M.B. Nilsson, J. S. Price, M. Röhl, A. Schneider, and B. Tiemeyer, 2019. PEAT-CLSM: A specific treatment of peatland hydrology in the NASA Catchment Land Surface Model. J. Adv. Model. Earth Sys., 11, 2130-2162. doi: 10.1029/2018MS001574. - _EOS1_ else cat << _EOS2_ > clsm/soil @@ -1033,8 +1032,8 @@ cat << _EOV1_ > clsm/veg1 with Mosaic types: 1 - Broadleaf Evergreen; 2 - Broadleaf Deciduous; 3 - Needleleaf; 4 - Grassland; 5 - Broadleaf Shrubs; 6 - Dwarf Trees - 3.2.2 vegdyn input data (mosaic primary type, canopy height, and roughness) for GEOS5 - . file name: vegdyn.data or ../vegdyn_*.dat + 3.2.2 vegdyn input data (mosaic primary type, canopy height, and roughness) for GEOS + file name: vegdyn.data or ../vegdyn_*.dat file format: fortran binaries, little_endian read ([UNIT]) (primary_veg_type(n),n=1,${NTILES}) read ([UNIT]) (canopy_height (n),n=1,${NTILES}) @@ -1280,7 +1279,7 @@ cat << _EOF0_ > clsm/README1 Meanwhile, the SiB-based albedo scheme was run at a daily time step over a 1-year period using the vegetation types, greenness fractions, and leaf area indices - established for GEOS-5 for a given distribution of land elements, as described + established for GEOS for a given distribution of land elements, as described in sections 3 and 4 above. Averaging the visible diffuse and near-infrared diffuse albedos generated by the scheme over 8-day periods produced, in effect, an 8-day ‘climatology’ of this particular scheme’s diffuse albedos. The ratio @@ -1294,7 +1293,10 @@ cat << _EOF0_ > clsm/README1 5.2 Data files and movies 5.2.1 MODIS Albedo Climatology [Diffused, Visible (0.3_0.7) and Near-Infrared (0.7_5.0); - Note: GEOS5/CLSM does not read these data + Note: These data are not read into GEOS. They are needed to derive the albedo + scaling parameters (Section 5.2.2), which are used in conjunction with + sun-angle dependent lookup values to achieve albedo values that match + the MODIS climatology while preserving the diurnal cycle. [Movie 3 : "plots/VISDF.mp4" (Diffused visible) and Movie 4 "plots/NIRDF.mp4" (Diffused infrared)] file names : ${AlbFileNames} @@ -1451,7 +1453,7 @@ cat << _EOF1_ > clsm/README2 codes together allows the construction of a catchment network within the basin. Verdin (2013) provided global raster arrays of global Level 12 Pfafstetter codes at 1-arcmin resolution along with information on mean elevation. These data sets - were used to build the global river channel network slated for use with GEOS-5. + were used to build the global river channel network slated for use with GEOS. The steps used to generate the river network are as follows. Each catchment (referred to in this discussion as CatchX) has up to two upstream catchments