metno / pysurfex

Python API to SURFEX. Tool to create offline SURFEX forcing, SURFEX files, running SURFEX and plot results.
10 stars 16 forks source link

output pf5 or other diagnostics #3

Closed xushanthu-2014 closed 3 years ago

xushanthu-2014 commented 3 years ago

Hello hope this message finds you well! I am a user who is using open-SURFEX and wants to output pf5 (or the f2 factor from the surfex codes). I found that this variables is a local variable in the isba.f90 script (please correct me if I missed something). So how can I output it? is your python code able to do that? by the way, I found that in src/SURFEX/modd_diag_misc_isban.F90, there is a comment: ! B. Decharme 07/2012 : New diag for DIF under LSURF_MISC_DIF key !! F2 stress !! Root zone swi, wg and wgi !! swi, wg and wgi comparable to ISBA-FR-DG2 and DG3 layers but I didn't find f2 stress in the type DIAG_MISC_ISBA_t. And I found from https://www.umr-cnrm.fr/surfex/spip.php?article96 LSURF_MISC_DIF allows people to output diagnostics as the users wish (please correct me if I was wrong). So how can I use that? By the way, I found that from the definition, f2 seems has a same calculation as liquid soil wetness index (swirl). Is that correct? can I use swi as f2? Thanks and hope for your early reply! Sincerely

trygveasp commented 3 years ago

Pysurfex is a python library which can create namelists and execution environment for SURFEX (also open-SURFEX). However, it does not modify the FORTRAN source code, it just runs the binaries. It means you will need to output the extra variables yourself. You could also ask for help using the address surfex-support@meteo.fr

You can enable LSURF_MISC_DIF in you namelist. However, you have to check the source code which variables are written to file. The fields are not defined by the user directly, but you get some variables from the ISBA diffusion scheme by enabling it.