Main changes in SURFEX v8
Branch NEW_PREP (MOSAYC)
NB: some default values for namelist options changed in V8.
First, see:
http://www.cnrm.meteo.fr/surfex-lab/spip.php?article357&var_mode=calcul
Then, default for LNOSOF and LVERTSHIFT from NAM_SURF_ATM are inverted:
http://www.cnrm.meteo.fr/surfex-lab/spip.php?article77&var_mode=calcul
Also, values for GMES_ST (used with CPHOTO = NIT,AST,LST,NCB) in ini_data_param.F90 changed :
GMES_ST | V7_3 | V8 |
---|---|---|
NO | 0.003 | 0.003 |
ROCK | 0.003 | 0.003 |
SNOW | 0.003 | 0.003 |
TEBD | 0.003 | 0.0018 |
TRBD | 0.003 | 0.0012 |
TEBE | 0.003 | 0.0019 |
BOBD | 0.003 | 0.0018 |
SHRB | 0.003 | 0.0016 |
BONE | 0.002 | 0.0019 |
TENE | 0.002 | 0.0019 |
BOND | 0.002 | 0.0012 |
TRBE | 0.002 | 0.0012 |
C3 | 0.001 | 0.001 / 0.00175 |
C4 | 0.001 / 0.009 | 0.006 / 0.0098 |
IRR | 0.001 / 0.009 | 0.006 / 0.0098 |
GRAS | 0.001 | 0.0024 |
BOGR | 0.001 | 0.0024 |
TROG | 0.006 | 0.017 |
PARK | 0.001 | 0.0024 |
For crops types, "/" indicates LAGRI_TO_GRASS=T/LAGRI_TO_GRASS=F.
Contains:
- Short-term optimizations of PREP step proposed by ALADIN in March 2013 (Tayfun Dalkilic, Daan Degrauwe):
- PATCH AVERAGING:
- the loop on covers is reduced to a loop on effective present covers on the area.
- open-mp directives are added to still improve this loop.
- generalization by reducing the size of array XCOVER to the present covers in the area, in PREP but also in PGD step (leads to use less memory)
- BILIN INTERPOLATION:
- hor_interpol is no longer systematically called for all 12 vegtypes.
- the fortran function count that takes much resource is replaced by an optimized code.
- open-mp directives are added to improve the more expensive loops.
- PATCH AVERAGING:
- optimizations of PGD in GAUSSIAN grid:
- changes in the writing of the loops
- adds of open-mp directives to improve the more expensive loops during the index calculation.
- PGD and PREP files can be written and read in NETCDF format:
- new specific I/O routines
- Library XRD38 is replaced by XRD39:
- lead to include USE MODI of FA routines in SURFEX code, what is not totally satisfying (incompatible with the GMKPACK compilation) and should be revised.
- A PREP file can enter the namelist only for the snow part:
- the entry for the PGD corresponding file was missing
- Corrections in the chemical part:
- in collaboration with CAIAC (M. Michou, P. Hamer, D. Saint Martin)
- NEW_PREP was used to test and validate the new base of automatic tests. This lead to 3 categories of changes in the code:
- bugs were detected thanks to the base of tests and corrected in NEW_PREP, notably for the parallelization with OPEN-MP,
- for an optimal use of the base of tests, names of namelists entries were changed so that they are specific to each block (a same namelist entry can’t appear in two different blocks),
- new diagnostics were added in NETCDF format, especially for the TEB part.
- CROCUS files are re-written following SURFEX rules for names of variables and typography, and trying to make common subroutines when the same code is used in different places:
- this lead to include a part of the CEN contribution
Remarks:
- Some adds for PGD & PREP files in NETCDF format are not set yet, for example the possibility to use NETCDF format in case of a LIMP_ZS, LIMP_COVER or other LIMP_... in running PGD.
Branch NEW_PREP_HIRLAM (MET.no, SMHI, R. Hamdi) built on top of NEW_PREP
Reminder:
SODA aims at gathering and externalizing developments around data assimilation in SURFEX.
For the moment, VARASSIM from Alina Barbu is not merged with SODA. So, a question remains if VARASSIM has to be put in SURFEX V8, and if yes, if in or out of SODA. It has been agreed to merge VARASSIM developments by Alina and SODA by HIRLAM, but it has not been agreed at which time this should happen. SURFEX V8 might come too soon for this.
Branch contains:
- Separate IO in SODA from the assimilation part. This allows us to use the main IO infrastructure of surfex and to be able to call SODA from CANARI. Assimilation related code moved to src/ASSIM.
- EKF initialization updates
- Extrapolation of variables. Allow optional extrapolation in PREP step through namelist variables LEXTRAP_TG,LEXTRAP_WG,LEXTRAP_WGI,LEXTRAP_SN. Disabled by default.
- Set an upper limit for extrapolation distance
- Allow search over a subdomain by providing NDIM2 in the call to OI_HOR_EXTRAPOL_SURF.F90
- Fix to prevent use of uninitialized values in solar zenith calculations when running soda.
- Optional weighting of grid average T2M giving more weight to the land tiles. Controlled by LT2MMW and switched off by default
- Add exchange coefficient PCD to Get_FLUX_n interface ( Rafiq Hamdi (ALADIN), but needed when running ALARO for coupled mode)
- Control of upper limit on initial snow water equivalent through LSWEMAX and XSWEMAX
- Optional removal of small snow values through LAESNM
- Fix for vegetation_update.F90 to be OpenMP safe for ECOCLIMAP-II and use the correct 10 day periods for months with 31 days.
Branch V8_GMAP, built on top of NEW_PREP_HIRLAM
This branch correspond to the code that was entered in Cy40t1 and is also known as surfexv7.3+
1) Optimisations PREP (openMP) and bfs for oi_control ( from Mohanmed Jidane and Francoise Taillefer):
- surfex/ASSIM/oi_control.F90 (correction for 10m winds when it is above forcing level)
- surfex/SURFEX/hor_extrapol_surf.F90 ( OpenMP for PREP)
- surfex/SURFEX/hor_interpol_gauss.F90
- surfex/SURFEX/prep_grid_gauss.F90 (debugging PREP, lecture lfi global gauss grid)
2) For stochastic flux perturbations (F. Bouttier) : (under logical switches LPERTFLUX for sea in NAM_SEAFLUXn, LPERTSURF for isba in NAM_ISBAn)
- Purpose: implement stochastic surface perturbations for ensemble prediction. This code will be used in the MF AROME ensemble prediction system.
- Description:
- initial perturbation of surface fields are prepared before the forecast by an external program that manipulates the Surfex initial conditions file to
- (1) alter some prognostic fields, and
- (2) append some perturbation patterns for physiographic fields.
- The code modifications perform two tasks:
- to read and apply perturbations to fields that cannot be easily perturbed directly in the initial file.
- to preserve initial perturbations of quasi-constant fields (ISBA veg, lai, cv,albedo, Z0), even when there is a decadal update of physiographic fields from PGD.
- Details:
- Both are achieved by storing the field perturbations in new modd_isban module fields XPERTVEG, XPERTLAI, XPERTCV, XPERTALB, XPERTZ0.
- The perturbations are read from the initial file in compute_isba_parameters.
- The same albedo perturbation pattern is applied to all ISBA albedoes.
- The same Z0 perturbation pattern is applied to all ISBA roughness parameters, except vegetation Z0.
- The physiographies for non-ISBA surfaces (ice, snow, town, flood, etc) are not perturbed.
- The surface perturbation code is activated by two namelist switches:
- NAM_ISBAn/LPERTSURF: perturbations of ISBA (veg,lai,cv,albedo,Z0). Requires fields PERTALB and PERTZ0LAND from initial file.
- NAM_SEAFLUXn/LPERTFLUX: multiplicative perturbation of Ecume fluxes. Requires field PERTSEAFLUX from initial file.
- When these switches are off, the code is bit-reproducible, and standard initial files can be used.
- initial perturbation of surface fields are prepared before the forecast by an external program that manipulates the Surfex initial conditions file to
- compute_isba_parameters.F90
- hor_extrapol_surf.F90
- modn_seafluxn.F90
- coupling_isban.F90
- hor_interpol_gauss.F90
- oi_control.F90
- coupling_seafluxn.F90
- modd_isban.F90
- prep_grid_gauss.F90
- ecume_flux.F90
- modd_seafluxn.F90
- read_seafluxn.F90
- ecume_seaflux.F90
- modn_isban.F90
- vegetation_update.F90
3) Pb compilation on IBM (from Ryad El Khatib and Oldrich Spaniel) : most of the modifications are linked with the renaming of "NINDX2" from MODD_SURFEX_OMP as "NINDX2SFX"
- ch_init_snapn.F90
- gather_and_write_mpi.F90
- gather_and_write_mpi_k4.F90
- get_size_fulln.F90
- init_io_surf_fan.F90
- init_surf_atmn.F90
- modd_surfex_omp.F90
- pgd_grid.F90
- pgd_surf_atm.F90
- pgd_teb_veg.F90
- prep_isba_netcdf.F90
- prep_ocean_ascllv.F90
- read_and_send_mpi.F90
- read_csvdata_teb.F90
- read_isban.F90
Branch V8_BV, built on top of V8_GMAP
ISBA-TOP improvements :
Branch V8_VM, built on top of V8_BV
TEB improvements
- watering:
watering of gardens and greenroofs.
Activated in a specific namelist.
By default, the watering is non-existent.
The amounts for watering are in litres/day (or kg/m2/day).
Time slots and months for are specified by user.
The watering occuring in ISBA, there is a new input variable in isba.F90. - fraction of residential use:
XUNIF_RESIDENTIAL=0.5, read in namelist NAM_DATA_TEB
used only for solar panels and occupying schedule - solar panels on roofs:
- in NAM_TEB: LSOLAR_PANEL=T
- in NAM_DATA_TEB:
- XUNIF_FRAC_PANEL= 0.50 ! fraction of solar panels on roofs
- XUNIF_EMIS_PANEL=0.90 ! emissivity of solar panels
- XUNIF_ALB_PANEL=0.10 ! albedo of solar panels
- XUNIF_EFF_PANEL=0.14 ! efficiency of photovoltaic solar panels
- new diagnostics:
- PHOTC_BLD ! photovoltaics production cumuled on the length of simulation ( J/m2 of building at floor)
- THERC_BLD ! sanitary warm water production cumuled on the length of simulation ( J/m2 of building at floor)
Solar panels cover (give shadow and modify the incoming infra-red radiation below) roofs, even if they are also fitted with greenroofs.
- Remarks: the efficiency of thermal solar panels (for the sanitary warm water) is not in the namelist and was fixed to 0.60.
If the buildings in the grid point are purely of residential use, the Sanitary Warm Water is favoured, but after photovoltaics.
If the buildings are of other use, there is only photovoltaics.
If the use is mixed (for example 0.5), the sharing out is proportional.
- schedule of occupying:
- in NAM_TEBn:
- XDT_RES = 3. ! difference of ordered temperature (heating and cooling) when the building (residential) is not occupied : day (K)
- XDT_OFF = 3. ! difference of ordered temperature (heating and cooling) when the building (offices) is not occupied : nights and WE (K)
- In grid points where buildings are mainly residential (>0.5), it’s admitted that during day, buildings are unoccupied, the ordered heating decreases of XDT_RES degrees Celsius and the ordered cooling grows of XDT_RES degrees Celsius.
In grid points where builings are mainly not residential (<0.5),> during nights and WE, buildings are unoccupied, the ordered heating decreases of XDT_OFF degrees Celsius and the ordered cooling grows of XDT_OFF degrees Celsius.
Simulations done until now supposed that the ordered temperature would not be modified even if the buildings were unoccupied (XDT_RES=0. and XDT_OFF=0.). The study can go on with XDT_RES=0. and XDT_OFF=0. anyhow, the sensibility study will so give the influence of the ordered temperature.
- in NAM_TEBn:
- Cumulative UTCI stresses:
Values are in seconds.- UTCIC_IN_ECS corresponds to the time in seconds spent below the threshold of Extrem Cold Stress inside.
- UTCIC_IN_VCS corresponds to the time in seconds spent between the thresholds of Very Strong Cold Stress and Extrem Cold Stress inside.
- UTCIC_IN_NHS corresponds to the time in seconds spent in comfortable index inside.
- UTCIC_IN_MHS corresponds to the time in seconds spent between the thresholds of Medium Heat Stress and Strong Heat Stress inside.
- These times are on the total length of simulation (it can make a lot of seconds...)
- Glossary:
- ECS : extreme cold stress
- VCS : very strong cold stress
- SCS : strong cold stress
- MCS : medium cold stress
- LCS : light cold stress
- NHS : no heat stress (= comfortable)
- MHS : medium heat stress (to be noted that there is no Light Heat stress)
- SHS : strong heat stress
- VHS : very strong heat stress
- EHS : extreme heat stress
- _IN_ : indoors
- _SH_ : outdoors in shadow
- _SU_ : outdoors in sun
- Mechanical and controlled ventilation:
new option for the type of ventilation in buildings (namelist entry: NATVENT ). - Change of default values for roughtness of TEB walls:
&NAM_TEBn
CZ0H = "KAND07"
CCH_BEM = "DOE-2" - add/correction of diagnostics for min and max temperatures:
add in Flake (didn’t exist)
corrections in TEB - Various bugs and diagnostics, for TEB or GARDEN.
Branch V8_lafaysse, built on top of V8_VM and V8_VM_BUG
Branch V8_GMGEC_MEB, built on top of V8_FOR_UNIFIED_ASSIMILATION revision 2246
Branch V8_MESONH, built on top of V8_GMGEC_MEB revision 2745
Branch V8_ASSIM, built on top of V8_MESONH revision 2779
- a correction for TREEDRAG from Mesonh (XH_TREE must be initialized if LTREEDRAG=T and CPHOTO=’NON’
- DR_HOOK is now a library compiled with the rest of the SURFEX code (simpler). For the moment, the DR_HOOK sources are in directory DRHOOK_SIMPLE.
- Corrections for TOPMODEL, following running STRATO in Debug mode
- To print an error message if the namelist is not present in the run directory (E. Martin)
- An add from P. Tulet for the diagnostic for the wind at 10 meters
- An optimization for extrapolation during PREP when the interpolation is bilinear, and add of the possibility to write the ALBEDO diagnostics during PREP (L. Raynaud)
- Merge of OI_MAIN & SODA in SODA-OI (same results are obtained)
- Merge of VARASSIM & SODA in SODA-EKF (same results are obtained)
- Add of other CSURF_FILETYPE format than ASCII in SODA
- It’s now possible to set CTIMESERIES_FILETYPE=’NC’
Branch V8_RJTECH, built on top of V8_ASSIM revision 2851
See first: technical modifications from Hirlam about modifications inside the code.
Then, concerning compilation:
1). all scripts where made born shell compatible and point to /bin/sh for portability.
As a general recommendation all other shells should have ’#!/usr/bin/env SHELL’.
2). In bin/spll tool explicit .mod and .o moving by makefile rules rules disabled, because often breaks on lustre attached network systems, specially at partial recompile.
Also to avoid using VPATH outside SURFEX compilation directory, that can create lots of unexpected problems. Now handled directly by compiler options with $(REALFC) and $(MODOUT_FLAG) variables.
If compiler type is not known, the ".NOTPARRALLEL:" makefile rule is applied and compilation will be done as with make -j1, by using implicit mv commands for .mod files.
3). configure script is simplified to provide sane defaults that can be overriden by:
export ARCH=${ARCH} #arch name
export VER_MPI=${VER_MPI} #Version of MPI {VER_MPI=NOMPI,MPIVIDE,LAMMPI,MPIAUTO,...}
export VER_OMP=${VER_OMP} #Version of OMP {VER_OMP=NOOMP,OMP}, actually handled by user Rules file only
export OPTLEVEL=${OPTLEVEL} #OPTIMIZATION LEVEL {OPTLEVEL=DEBUG,O2}
export VER_USER=${VER_USER} #USER VERSION
export CONF_DOLLAR=${CONF_DOLLAR} # 'Scandollar' Post Processing default variables
export VERSION_CDF=${VERSION_CDF} #used only for CDFAUTO case, which redistributable archive to extract
export VER_CDF=${VER_CDF} #Version of NETCDF {VER_CDF=CDFAUTO,CDFEXT,...}
export VERSION_GRIBAPI=${VERSION_GRIBAPI} #used only for GRIBAPI_AUTO case, which redistributable archive to extractexport VERSION_OASIS=${VERSION_OASIS}
export VER_GRIBAPI=${VER_GRIBAPI} #Version of GRIBAPI {VER_GRIBAPI=GRIBAPI_AUTO,GRIBAPI_EXT}
export VERSION_OASIS=${VERSION_OASIS} #which redistributable archive to extract
export VER_OASIS=${VER_OASIS} #Version of OASIS {VER_OASIS=NOmct,mct}
export VER_DRHOOK=${VER_DRHOOK} #Version of DR_HOOK {VER_DRHOOK=SIMPLE,BYPASS,MINI}
4). AUTO gribapi and netcdf redistributable compilation is forced to be done before compiling MASTER.
This simplifies makefiles greatly and ensures that redistributables can be compiled for $(REALFC) compiler.
MPI versions were disabled, since rest of makefile assumes that $(F90) is $(REALFC). Also disabled user F90FLAGS propagation into these redistributables, to avoid using non standard/broken libraries.
Special note about -i8/-fdefault-integer-8 in these libraries, this can lead to bad output files.
5). In bin/spll added EXTERNAL variable that does module dependencies blacklisting currently it includes netcdf and gribapi, since external libraries should be assumed static.
6). In makefiles CPPFLAGS were renamed to FPPFLAGS to separate cpp defines for fortran and C parts.
Mainly done to avoid name collisions in new post XRD39 versions of FA/LFI c part variable names.
7). OASIS is off by default(NOmct), since it requires MPI and for running TESTS it is not needed. Oasis compilation flags are no longer static (make.inc_cnrm) but dynamic from user Rules file through oasis_sfx_make.inc copy after extracting redistributable. This allows to have agnostic setup.
8). ’make clean’ was fixed not to loop over and over
9). ’make user’ now can be done without having done ’make master’ previously. ’make user’ program linking list separated from $(PROG_LIST) into $(PROG_LIST_USER).
10). VER_OMP handling should be done by user Rules files, currently I just check if NOOMP is used and null out FCFLAGS_OMP CFLAGS_OMP flags.
11). added splr.pl script that replaces all spll/spn/awk/cpp functionality.
It uses my updated Fortran90_stuff.pm (with some bugfixes after testing on surfex).
Creates much cleaner/correct modi interfaces. Still -fimplicit-none is recommended.
It’s capable to :
- create .D dependencies (—deps flag)
- create spll_modi_* intefaces (—modi flag), optionaly to make generic interfaces
- split into separate units based on (—split flag)
- perform simple fpp (—fpp) by commenting out cpp directives with ’!zFPP ’ prefixes
- wrap splitted units into modules (—wrap flag)
Created inteface has name pattern spll_modi_NAME.f90.
Created splitted source has name pattern spll_NAME.F90
As a special case splr.pl contains some exceptions for SURFEX:
- read_surf/write_surf is not splitted until bug in SODA_OI2 (LEXTRAPOL_ISBA case) is fixed
- if file name contains (lonlat_rot|gltools_newice_r|glt_constrain_r) genric interface generation is disabled, since these files are not TKR (Type,Kind,Rank) compatible, passing za(*) to xa(*,*).
- $f90s_ALLOW_DIRTY_MOD_REGEX allows to select which non "USE ...,ONLY:" modules get included in interface for dependencies in dummy arguments declarations.
- If file name contains ’goto_’ then —wrap is disabled, since those subroutines are RECURSIVE
12). .F90 rules were added to makefile implicit compilation rules.
13). Special user selectable flags were added:
- $(USE_SPLR)=="YES" selects to use splr.pl for DEP step. Otherwise spll chain.
- $(AVOID_CPP)=="YES" used to bypass cpp usage on input source files. Sometimes it is useful to work with partially preprocessed files.
- $(USE_SPLR_WRAP)=="YES" to not generate separate spll_modi_ file, but to wrap whole unit into spll_modi_UNITNAME.F90. This implements part No.7 of Hirlam technical modifications document. Also it is great functionality for checking missing USE MODI in code tree.
- $(DO_ASM)=="YES" for assembly listing generation (.s), if not useful can be removed. I used it to ensure freeform changes were lexically identical to f77 file logic.
14) Several DRHOOK library variants were added:
- LIB/DRHOOK/BYPASS(dummy library), needed for my tools.
- LIB/DRHOOK/MINI (minimal functionality required for signal handling, tracebacks, drhook traces)
Still can do memory usage profiling, catch crashes, etc, just without MPL layer that allows to compile freely with/without MPI and/or OpenMP LIB/DRHOOK/MPL (together with MINI forms DRHOOK_SIMPLE), just for testing compatibility -DSFX_MPL.
15). few fixes in XRD39 FA/LFI so that use of FA modi interfaces no longer needed, -DOFF define removed.
16). custom XRD40 FA/LFI library with selective changes between XRD39 and XRD40, but without whole new c layer.
17). I/O specific CPP flags in surfex now prefixed with ’SFX_’ to avoid various problems.
18). -DNOMPI inverted to -DSFX_MPI to better explain it’s usage in GELATO and to avoid double NOT while reading code (#ifndef NOMPI, #if !defined NOMPI)
Also -DSFX_MPI handled automatically by $(VER_MPI) value if it is not "NOMPI"
19). temporary cpp define ’-DRJ_OFIX’ was added to fix NOOMP version of OFFLINE execution. After review it should be removed in final version. Same for -DRJ_PFIX.