123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219 |
- # namelist.osm.sh
- ## TO FIX
- #--------------------------------------
- # Setup defaults
- # -------------------------------------
- LEVGEN=${LEVGEN:-true}
- LESSRO=${LESSRO:-true}
- LESN09=${LESN09:-true}
- LRDALB=${LRDALB:-false}
- N_COMPUTE_EFF_VEG_FRACTION=${n_compute_eff_veg_fraction}
- LE4ALB=${LE4ALB:-true}
- LELAIV=${LELAIV:-true}
- LREADDAY=${LREADDAY:-true}
- NINDAT=$(date -u -d "${run_start_date}" +%Y%m%d)
- IFYYYY=$(echo $leg_start_date_yyyymmdd | cut -c1-4)
- IFMM=$(echo $leg_start_date_yyyymmdd | cut -c5-6)
- IFDD=$(echo $leg_start_date_yyyymmdd| cut -c7-8)
- IFTIM=0000
- # Find out forcing frequency
- t2=$( cdo -s -infov -selvar,LWdown -seltimestep,2 ${osm_forcing_dir}/${leg_start_date_yyyy}/LWdown.nc | tail -1 | awk '{print $3,$4}')
- t1=$( cdo -s -infov -selvar,LWdown -seltimestep,1 ${osm_forcing_dir}/${leg_start_date_yyyy}/LWdown.nc | tail -1 | awk '{print $3,$4}')
- ZDTFORC=$(( $( date -u -d "$t2" +%s) - $( date -u -d "$t1" +%s) ))
- [ $LREADDAY = true ] && NDFORC=$(( 86400/ZDTFORC +2 )) || NDFORC=1
- # set the reference levels for near-surface temp, humidity and wind
- # ZPHISTA REFERENCE LEVEL (FOR T, Q)
- # ZUV REFERENCE LEVEL FOR WIND
- # ZPHISTA is assumed to be always 2, except for erai and era5
- ZPHISTA=2.
- case "${osm_forcing_type}" in
- ifs) ZPHISTA=2. ;;
- erai) ZPHISTA=10. ;;
- era5) ZPHISTA=10. ;;
- e20c) ZPHISTA=2. ;;
- gswp3) ZPHISTA=2. ;;
- *) info "unknown OSM forcing type osm_forcing_type, setting ZPHISTA=2."
- ;;
- esac
- # ZUV is assumed to be always 10
- ZUV=10.
- LPROD=".TRUE."
- LPROD2=".FALSE."
- NDLEVEL=0
- NCDFTYPE=4
- case "${ifs_grid}" in
- T159L*) NLON=35718 ;;
- T255L*) NLON=88838 ;;
- T511L*) NLON=348528 ;;
- *) error "Can't set time steps for unknown horizontal grid: ${ifs_grid}"
- ;;
- esac
- # end of Defaults
- # ---------------------------------------
- #--------------------------------------
- # Start || Restart
- #-------------------------------------
- NSTART=$(( leg_start_sec / ifs_time_step_sec ))
- NSTOP=$(( leg_end_sec / ifs_time_step_sec ))
- # TODO check this when multi-year files are generated!
- forcing_end=$(cdo -s -infov -selvar,LWdown -seltimestep,-1 ${osm_forcing_dir}/${leg_end_date_yyyy}/LWdown.nc | tail -1 | awk '{print $3,$4}')
- forcing_end=$(date -uR -d "${forcing_end}")
- forcing_end_sec=$(( $(date -u -d "${forcing_end}" +%s) - $(date -u -d "${run_start_date}" +%s) ))
- if [ ${forcing_end_sec} -lt ${leg_end_sec} ]
- then
- if [ $(date -u -d "${leg_end_date}" +%s) -eq $(date -u -d "${run_end_date}" +%s) ] && [ $((forcing_end_sec+ZDTFORC)) = $leg_end_sec ]
- then
- NSTOP=$(( forcing_end_sec / ifs_time_step_sec ))
- else
- info "$NSTOP,$forcing_end,$forcing_end_sec"
- error "NSTOP > forcing availability"
- fi
- fi
- if [ $NSTART = 0 ]
- then
- # Start
- LNF=true
- ln -sf soilinit restartin.nc
- else
- # Restart
- test -f restartin.nc || error "restartin.nc not present"
- LNF=false
- fi
- ## Find out domain size
- NLAT=$( ncdump -h restartin.nc | grep "^.y = " | head -1 | awk '{print $3}' )
- NLON=$( ncdump -h restartin.nc | grep "^.x = " | head -1 | awk '{print $3}' )
- if [[ $NLON = "" ]]; then
- NLAT=$( ncdump -h restartin.nc | grep "^.lat = " | head -1 | awk '{print $3}' )
- NLON=$( ncdump -h restartin.nc | grep "^.lon = " | head -1 | awk '{print $3}' )
- fi
- NDIMCDF=2
- if [[ $NLAT = "" ]]; then
- NDIMCDF=1
- NLAT=0
- fi
- # Switch on/off LPJ-GUESS feedback to IFS
- (( ${lpjg_on:-} )) && LLPJGON=TRUE || LLPJGON=FALSE
- (( ${lpjg_fdbck:-} )) && LLPJGFBON=TRUE || LLPJGFBON=FALSE
- cat << EOF
- &NAMCT01S
- NSTART=$NSTART ! first timestep of model 0
- NSTOP=$NSTOP ! last timestep of model 17520
- NFRPOS=$ifs_output_freq ! frequency of post-processing events (time-steps)
- NFRRES=0 ! frequency of writing intermediate restart files (time-steps)
- LNF=$LNF ! .T. = start, .F. = restart
- NCYCLE=1 ! number of the experiment
- CNMEXP="${exp_name}" ! name of the experiment
- /
- &NAMDYN1S
- TSTEP=$ifs_time_step_sec ! TSTEP : length of the timestep in seconds
- NACCTYPE=2 ! =0 Forcing fluxes assument centered on timestamp (linear interp.)
- ! =1 forward accumulation (starting at timestamp)
- ! =2 backward accumulation (ending at timestamp)
- LSWINT=.TRUE. ! SWdown solar angle interpolation if true
- LPREINT=.FALSE. ! precipitation interpolation if true
- LFLXINT=.FALSE. ! SWdown/LWdown linear interpolation if true
- /
- &NAMDIM
- NLAT=$NLAT ! number of latitudes
- NLON=$NLON ! number of longitudes
- NDFORC=$NDFORC ! namelist forcing dimension
- NSLAB=0 ! 2D, NSLAB = nr of latitude lines
- NPROMA=240 ! working dimension for grid-point computations
- /
- &NAMRIP
- NINDAT=${NINDAT} ! run initial date in the form YYYYMMDD
- NSSSSS=0 ! initial time in seconds (e.g. for 12h, 43200)
- /
- &NAM1S
- CFFORC='netcdf' ! CHARACTER: IDENTIFIES THE FORCING DATA SET
- CFOUT='netcdf' ! CHARACTER: IDENTIFIES THE OUTPUT DATA SET
- CFSURF='netcdf' ! CHARACTER: IDENTIFIES THE SURFACE CLIMATOLOGY DATA SET
- CFINIT='netcdf' ! CHARACTER: IDENTIFIES THE INITIALIZATION DATA SET
- CMODID='EC-EARTH' ! CHARACTER: MODEL IDENTIFICATION
- CVERID='EC-EARTH' ! CHARACTER: VERSION IDENTIFICATION
- LACCUMW=.TRUE. ! LOGICAL : WRITE OUT ACCUMULATED FLUXES (DEFAULT=TRUE)
- LRESET=.TRUE. ! LOGICAL : RESET ACCUMULATION EVERY WRITE OUT TIME STEP
- NACCUR=1 ! INTEGER : OUTPUT CDF ACCURACY: 1=SINGLE PREC, 2=DOUBLE PREC
- NDIMCDF=${NDIMCDF} ! INTEGER : NR OF GRID DIMENSIONS
- NDLEVEL=${NDLEVEL} ! INTEGER : Level of netcdf4 compression 0-9: 0== no compression -faster output
- NCDFTYPE=${NCDFTYPE} ! type of netcdf output
- LNCSNC=.FALSE. ! if true sync netcdf output every writting step (slows down run)
- LWRGG=$LPROD ! logical, wrtie o_gg - instantaneus prognostics
- LWRCLM=$LPROD ! logical, write o_fix - fix soil properties
- LWRGGD=.FALSE. ! logical, write o_ggd - mean prognostic evolution
- LWREFL=$LPROD ! logical, write o_efl - surface energy balance
- LWRWAT=$LPROD ! logical, write o_wat - water balance
- LWRD2M=$LPROD ! logical, write o_d2m - 2 meters diagnostics
- ! TODO only save daily 66,67,27,28,29,30 for icmcl
- LWRSUS=$LPROD ! logical, write o_sus - surface state variables (vegT,albedo, etc..)
- LWREVA=$LPROD2 ! logical, write o_eva - evaporation components
- LWRCLD=$LPROD2 ! logical, write o_cld - cold processes variables
- LWRCO2=.FALSE. ! logical, write o_co2 - cO2 fluxes
- LWRBIO=.FALSE. ! logical, write o_bio - biomass
- LWRVEG=.FALSE. ! logical, write o_veg - vegetation 2D high/low veg
- LWRVTY=.FALSE. ! logical, write o_vty - vegetation 2D high/low veg biomass
- LWRTIL=.FALSE. ! logical, write o_til - tiles 2D (tile) state
- LWRLKE=.FALSE. ! logical, write o_lke - lake variables
- LSEMISS=.FALSE. ! LOGICAL : EMISSIVITY SET TO CONSTANT VALUE REMISS
- LDBGS1=.FALSE. ! LOGICAL : PRINT DEBUG INFO, EG FORCING DATA (DEFAULT=FALSE)
- IDBGS1=2 ! Debug level : output printing
- LREADDAY=${LREADDAY} ! Logical: read daily chuncks
- /
- &NAMFORC
- ZPHISTA=${ZPHISTA} ! REFERENCE LEVEL (FOR T, Q) last model level ERAI
- ZUV=${ZUV} ! REFERENCE LEVEL FOR WIND last model level ERAI
- ZDTFORC=$ZDTFORC ! FORCING TIME STEP 3h forcing from ERAI
- IFYYYY=$IFYYYY ! REFERENCE YEAR
- IFMM=$IFMM ! REFERENCE MONTH
- IFDD=$IFDD ! REFERENCE DAY
- IFTIM=$IFTIM ! REFERENCE TIME (HHMM)
- INSTFC=0 ! NUMBER OF TIME STEPS TO BE READ (0 = ALL)
- NDIMFORC=${NDIMCDF} ! NUMBER OF GRID DIMENSIONS in FORCING
- LOADIAB=.FALSE. ! FLAG FOR APPLYING ADIABATIC HEIGHT CORRECTION
- CFORCV="forcing"
- CFORCU="Wind.nc"
- CFORCT="Tair.nc"
- CFORCQ="Qair.nc"
- CFORCP="PSurf.nc"
- CFORCRAIN="Rainf.nc"
- CFORCSNOW="Snowf.nc"
- CFORCSW="SWdown.nc"
- CFORCLW="LWdown.nc"
- /
- &NAMPHY
- LEVGEN=$LEVGEN ! LOGICAL : TURN THE VAN GENUCHTEN HYDROLOGY ON
- LESSRO=$LESSRO ! LOGICAL : TURN THE SUB-GRID SURFACE RUNOFF ON
- LEFLAKE=.FALSE. ! LOGICAL : TURN THE FLAKE ON
- LESN09=$LESN09 ! LOGICAL : TURN THE NEW SNOW PARAMETERIZATION ON
- LEINTWIND=.T.
- LECLIM10D=.F. ! LOGICAL : TURN usage of 10-day Climatology for Alb and LAI
- LE4ALB=$LE4ALB
- LELAIV=$LELAIV
- /
- &NAMPHYOFF
- LRDALB=$LRDALB
- N_COMPUTE_EFF_VEG_FRACTION=${N_COMPUTE_EFF_VEG_FRACTION}
- LRDVEG=.TRUE.
- LLPJG = ${LLPJGON},
- LLPJGFB = ${LLPJGFBON},
- /
- EOF
|