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..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 @@ -38,14 +38,9 @@ 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 -set MYTAG=`head -1 clsm/TagName | tail -1` -/bin/rm clsm/Tag* - -# Set Mask/Topo speifics -######################## + +# Set Mask/Topo specifics +######################### set MYMASK=`head -6 clsm/mkCatchParam.log | tail -1` set NPfafs=291284 @@ -63,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 \ @@ -170,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'`" @@ -244,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 \ @@ -256,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 \ @@ -281,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 \ @@ -359,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 (GEOS) Model + ${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 @@ -432,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 @@ -470,20 +461,20 @@ 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 input options and log ................................. A-I ===================================================================================== -====================================== PAGE 1 ====================================== +=================================== SECTION 1 ====================================== ===================================================================================== 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 - `echo "$int_str1"` The ${mygrid} - grid comprises of ${NGLOBAL} number of tiles globally, out of which ${NTILES} are - catchment-tiles. + 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. An ${NC}x${NR} integer array of tile indices is saved in Fortran binary file "../rst/${gfile}.rst" in little-endian format. @@ -498,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 @@ -556,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). @@ -571,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} - read (10,*)type,`echo "${sec2_til}"` + read ([UNIT],*) type,`echo "${sec2_til}"` end do where for each tile: @@ -585,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 - read (10,*) NTILES + read ([UNIT],*) NTILES do n = 1, ${NTILES} - read (10,'(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: @@ -603,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 - read (10,*) NTILES + read ([UNIT],*) NTILES do n = 1, ${NTILES} - read (10,'(i10,i8,5(1x,f8.4))') tile_index,pfaf_code, & - cti_mean, cti_std, cti_min, cti_max, cti_skew + 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: @@ -627,10 +618,10 @@ 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)') & - 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: @@ -659,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 ======================================================================== @@ -921,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 @@ -947,14 +938,13 @@ 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 - read (10,'(i10,i8,i4,i4,3f8.4,f12.8,f7.4,f10.4)') & - 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: @@ -990,7 +980,7 @@ cat << _EOV1_ > clsm/veg1 610.1 NASA/GSFC. ===================================================================================== -====================================== PAGE 3 ====================================== +=================================== SECTION 3 ====================================== ===================================================================================== 3. VEGETATION CLASSIFICATION DATA @@ -1022,9 +1012,9 @@ 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, & - 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: @@ -1042,12 +1032,12 @@ 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(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 @@ -1056,11 +1046,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} - read (10,'(2I8,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: @@ -1131,8 +1121,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} - read (10, '(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: @@ -1156,8 +1146,8 @@ 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)') & - 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: @@ -1179,10 +1169,11 @@ cat << _EOV2_ > clsm/veg2 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 _EOV2_ endif @@ -1197,7 +1188,7 @@ cat << _EOF0_ > clsm/README1 `echo "${sec3_veg_cite}"` ===================================================================================== -====================================== PAGE 4 ====================================== +=================================== SECTION 4 ====================================== ===================================================================================== 4. VEGETATION DYNAMIC DATA @@ -1206,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"] @@ -1224,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) @@ -1238,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) @@ -1252,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. @@ -1265,7 +1259,7 @@ cat << _EOF0_ > clsm/README1 `echo "${sec4_geo_cite}"` ===================================================================================== -====================================== PAGE 5 ====================================== +=================================== SECTION 5 ====================================== ===================================================================================== 5. SURFACE ALBEDO DATA @@ -1285,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 @@ -1299,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} @@ -1310,11 +1307,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 @@ -1324,11 +1322,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 @@ -1343,7 +1342,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 @@ -1369,8 +1368,8 @@ cat << _EOF0_ > clsm/README1 surfexec and rzexec file name : tau_param.dat do n = 1, ${NTILES} - read (10,'(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 [-] @@ -1382,8 +1381,8 @@ 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, & - 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: @@ -1395,7 +1394,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 + read ([UNIT],'(i10,i8,f5.2,3(2x,e13.7))') tile_index, pfaf_code, gnu, bf1, bf2, bf3 end do where: @@ -1407,8 +1406,8 @@ 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, & - 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: @@ -1440,7 +1439,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 @@ -1454,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 @@ -1503,12 +1502,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 - read (10,*) NPfafs + read ([UNIT],*) 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))') & - 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 @@ -1544,7 +1543,7 @@ endif cat << _EOF2_ > clsm/README3 ===================================================================================== -====================================== PAGE 8 ====================================== +=================================== SECTION 8 ====================================== ===================================================================================== 8. GLOBAL COUNTRY AND US STATE MAPS @@ -1559,18 +1558,17 @@ cat << _EOF2_ > clsm/README3 file name : country_and_state_code.data do n = 1, ${NTILES} - read (10,'(i8, 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 -CVS TAG : $MYTAG mkCatchParam LOG ~~~~~~~~~~~~~~~~ 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..20171d2e6 100755 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/make_bcs @@ -1,48 +1,64 @@ -#!/bin/tcsh -f +#!/bin/tcsh -f + +################################################################################ +# Help # +################################################################################ + +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 (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) 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), " + 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 -####################################################################### -# 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. -# -# ---- 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 -# 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. -# ####################################################################### # 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`/bin/make_bcs -set ESMADIR = `echo $cwd`/bin/ +if ( $HELPMODE != YES ) then -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 -set NCPUS = 20 -setenv OMP_NUM_THREADS 1 + 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 @@ -59,152 +75,270 @@ set WHITE = "\033[37m" set RESET = "\033[0m" set BOLD = "\033[1m" +####################################################################### +####################################################################### + +set pwd = `pwd` + set C1 = $RED set C2 = $BLUE set CR = $RESET ####################################################################### -####################################################################### +# +# Land bcs version (LBCSV) -set pwd = `pwd` +# set default land bcs version +set lbcsv = NL3 + +if ( $HELPMODE != YES ) then + echo "${CR}" + echo "Boundary Conditions (BCs) Package:" + 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 ####################################################################### +# +# Atmospheric Horizontal Resolution (HRCODE) -HRCODE: -echo " " -echo "Enter 1-5 character alphanumeric code to select specific ${C1}Atmospheric Horizontal Resolution ${CR} to be build:" -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 " " + echo "Enter 1-5 character alphanumeric code(s) for atmospheric horizontal resolution:" + echo "(Separate multiple entries by spaces.)" +else + 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}" +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 " " -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') goto HRCODE - 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 +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] + + 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 " ${C1} Invalid choice, try again:${CR}" + goto HRCODE + endif + if( $HRCODE != "$HRCODES" ) set HRCODES = `echo ${HRCODES} ${HRCODE}` + end -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 " " -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 " " -echo " (OR press ENTER If you want to use the develop version of land BCs.)" -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( $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 -####################################################################### + # figure out if one or more of the selected atmospheric resolutions is an EASE grid -if($HRCODES == m1 | $HRCODES == m3 | $HRCODES == m9 | $HRCODES == m36 | $HRCODES == m25) then - set orslvs = O1 + 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 + + +####################################################################### +# +# Ocean Horizontal Resolution (ORSLV) + +if ($isEASE > 0) then + set orslvs = O1 + + 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 " " + echo "Enter 2-6 character alphanumeric code(s) for ocean horizontal resolution:" + echo "(Separate multiple entries by spaces.)" + else + 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 )" + 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: - - echo - echo "Enter 2-6 character alphanumeric code (no dashes) to select specific ${C1}Ocean Resolution ${CR} to be build:" - 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 " (Select anything just to move forward for land-only EASE grids.)" - 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') goto ORSLV - if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` - end + + 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 " ${C1} Invalid choice, try again:${CR}" + goto ORSLV + endif + if( $orslv != "$orslvs" ) set orslvs = `echo ${orslvs} ${orslv}` + end 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} 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} 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} Experiment directory:${CR} ${C2}$EXPDIR${CR}" ####################################################################### ####################################################################### @@ -257,12 +391,12 @@ 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 +if($HRCODE == m1 | $HRCODE == m3 | $HRCODE == m9 | $HRCODE == m36 | $HRCODE == m25) then set GLOBAL_CATCH_DATA = ${l_data}/GEOS5_10arcsec_mask.nc endif @@ -494,10 +628,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'` @@ -530,7 +664,6 @@ while ("$group" == "") end -mkdir -p $pwd/logs ####################################################################### # LatLon Case @@ -546,20 +679,36 @@ 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 DATENAME = DE +set POLENAME = PE + 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 -mkdir -p $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 $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME.log -#SBATCH --error=$pwd/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 @@ -567,12 +716,11 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -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 @@ -587,7 +735,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} @@ -623,7 +770,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} @@ -690,6 +837,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 @@ -722,11 +871,24 @@ 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 +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 $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -734,8 +896,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/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=1 @@ -743,12 +905,11 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -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 @@ -763,7 +924,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} @@ -804,8 +964,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/$OUTDIR/logs/$BCNAME-2.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME-2.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -813,13 +973,11 @@ cat << _EOF_ > $BCJOB-2 #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -setenv ESMADIR $ESMADIR cd $pwd cd $BCDIR setenv MASKFILE $MASKFILE -source bin/g5_modules limit stacksize unlimited if( $LATLON_OCEAN == TRUE ) then @@ -922,6 +1080,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 @@ -935,8 +1095,8 @@ else cat << _EOF_ > $BCJOB #!/bin/csh -x -#SBATCH --output=$pwd/logs/$BCNAME.log -#SBATCH --error=$pwd/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 @@ -944,12 +1104,11 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -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 @@ -964,7 +1123,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} @@ -1089,6 +1247,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 @@ -1119,11 +1279,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 = $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 -mkdir -p $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 $EXPDIR/$OUTDIR/logs echo "${C1} Creating:${CR} ${C2}$BCJOB${CR}" /bin/rm -f $BCJOB @@ -1131,8 +1305,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/$OUTDIR/logs/$BCNAME.log +#SBATCH --error=$EXPDIR/$OUTDIR/logs/$BCNAME.err #SBATCH --account=$group #SBATCH --time=12:00:00 #SBATCH --ntasks=28 @@ -1140,16 +1314,14 @@ cat << _EOF_ > $BCJOB #SBATCH --chdir=$pwd/$BCDIR #SBATCH --constraint=sky -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 cd ../ -source bin/g5_modules limit stacksize unlimited if ( $EVERSION == EASEv2 ) then setenv MASKFILE ${MASKFILE} @@ -1182,7 +1354,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 @@ -1244,6 +1416,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 @@ -1277,9 +1451,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`" 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..2675f127d 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: ! @@ -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 : 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. ! @@ -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 ------------ ! @@ -98,14 +99,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 : Choose bcs version (F25, GM4, ICA, NL3, NL4, NL5, or DEV) " ! Process Arguments !------------------ @@ -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,48 +217,131 @@ 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) - if (.not.file_exists) call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) - write (log_file,'(a)')'Done creating catchment.def file ..........................1' + inquire(file=trim(fname_tmp), exist=file_exists) + if (.not.file_exists) then + write (log_file,'(a)')' Creating file...' + call catchment_def (nc,nr,regrid,dl,gridnamet,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + else + 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) - if (.not.file_exists) call cti_stat_file (ease_grid,gridnamet, MaskFile) - write (log_file,'(a)')'Done creating CTI stat file ...............................2' + + 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 file...' + call cti_stat_file (ease_grid,gridnamet, MaskFile) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' ! Creating vegetation classification files !----------------------------------------- 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) - inquire(file='clsm/CLM_veg_typs_fracs', exist=file_exists) - if (.not.file_exists) call ESA2CLM (nc,nr,gridnamer) - inquire(file='clsm/CLM4.5_veg_typs_fracs', exist=file_exists) - if (.not.file_exists) call ESA2CLM_45 (nc,nr,gridnamer) - write (log_file,'(a)')'Done creating vegetation types using ESA land cover........3' - + + 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 file...' + call ESA2MOSAIC (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' + + 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 file...' + call ESA2CLM (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' + + 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 file...' + call ESA2CLM_45 (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' + else + + 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 file...' + call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' - inquire(file='clsm/mosaic_veg_typs_fracs', exist=file_exists) - call compute_mosaic_veg_types (nc,nr,ease_grid,regrid,gridnamet,gridnamer) + ! 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].' + write (log_file,'(a)')' SKIPPING Step 04 and Step 05 !!!' + write (log_file,'(a)')' ' - write (log_file,'(a)')'Done creating vegetation types using IGBP SiB2 land cover..3' endif ! Processing Vegetation Climatology ! --------------------------------- ! creating mapping arrays if necessary + + 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_' @@ -269,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 @@ -277,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 @@ -289,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) @@ -332,130 +426,239 @@ 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,a,a)')'Done computing ', trim(LAIBCS),' vegetation climatologies .............4' - + write (log_file,'(a)')' ' + + ! ------------------------------------------------- + ! 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 + + + 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,a,a)')'Done putting ',trim(MODALB), ' Albedo on the tile space .............5' + write (log_file,'(a)')' ' if(.not.F25Tag) then deallocate (maparc30%map) deallocate (maparc30%ij_index) endif - 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)')' ' + + ! 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) - write (log_file,'(a,a,a)')'Done computing ',trim(MODALB), ' scale factors .......................6' -! 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 (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)')' ' + endif ! Creating soil_param.first and tau_param.dat files that has 2 options: ! 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)')' Creating file...' 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) + if(SOILBCS=='HWSD') call soil_para_hwsd (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a,a)')' Using existing 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)')' ' + + 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.' + else + write (log_file,'(a,a)')' Using existing files.' endif - write (log_file,'(a,a,a)')'Done computing CLSM model parameters based on ',trim(SOILBCS),'.........8' - + 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) ! 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.' + 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 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.' + else + write (log_file,'(a)')'Skipping step for lack of matching veg types file.' endif + write (log_file,'(a)')' ' + + 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 file...' + call CLM45_fixed_parameters (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' + + 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 file...' + call CLM45_clim_parameters (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + write (log_file,'(a)')' Using existing file.' + endif + write (log_file,'(a)')' ' - 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' - - 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' - - 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' - - ! 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) - + 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)')' Creating file...' + call map_country_codes (nc,nr,gridnamer) + write (log_file,'(a)')' Done.' + else + 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) + write (log_file,'(a)')'============================================================' write (log_file,'(a)')'DONE creating CLSM data files...............................' write (log_file,'(a)')'============================================================' - -! call system ('chmod 755 bin/create_README.csh ; bin/create_README.csh') + write (log_file,'(a)')' ' + + ! call system ('chmod 755 bin/create_README.csh ; bin/create_README.csh') endif close (log_file,status='keep') 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..d517bfe14 100644 --- a/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 +++ b/GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/rmTinyCatchParaMod.F90 @@ -109,14 +109,14 @@ 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' @@ -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') 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 f079a37eb..f6d270051 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 @@ -1421,7 +1421,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') @@ -1478,7 +1478,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