Welcome, Guest
Username: Password: Remember me
Forum on HARMONIE Climate Branch

TOPIC: gl crashes after modifying trans_tab.h

gl crashes after modifying trans_tab.h 1 year 3 months ago #2193

Hello,

I have included new translations for variables associated to patches. For example:

i = i + 1
trans_tab( i ) = trans('X001TG1 ',' ',' ',1,001,011,t%lev,105,0,'Surface temperature layer1 (isba)','')
i = i + 1
trans_tab( i ) = trans('X002TG1 ',' ',' ',1,001,011,t%lev,105,0,'Surface temperature layer1 (isba)','')
i = i + 1
trans_tab( i ) = trans('X003TG1 ',' ',' ',1,001,011,t%lev,105,0,'Surface temperature layer1 (isba)','')

After this changes, I obtain this error (and backtrace) that I didn't obtain before the modifications:

Open:ICMSHHARM+00720.sfx
SFX.SIC > 001:091- 000-102@19900601_00:00+720h00m tri:000 000 SIC 0.000E+000 0.000E+000 0.000E+000 0.000E+000
SFX.SST > 001:011- 000-102@19900601_00:00+720h00m tri:000 000 SST 290.167E+000 293.872E+000 296.991E+000 2.169E+000
SFX.TS_WATER > 001:011- 770-105@19900601_00:00+720h00m tri:000 000 TS_WATER 287.072E+000 301.826E+000 310.447E+000 2.932E+000
SFX.T_WML > 19900601_00:00+720h00m 000 287.072E+000 301.826E+000 310.447E+000 2.932E+000
SFX.T_BOT > 19900601_00:00+720h00m 000 277.130E+000 282.671E+000 291.877E+000 2.978E+000
SFX.H_SNOW > 19900601_00:00+720h00m 000 0.000E+000 0.000E+000 0.000E+000 0.000E+000
SFX.H_ML > 19900601_00:00+720h00m 000 895.581E-003 1.512E+000 3.473E+000 368.023E-003
X001TG1 > 19900601_00:00+720h00m 000 269.644E+000 288.241E+000 307.192E+000 5.672E+000
*/*/* FANFAR - ARGUMENTS= -86, 1, ' ', 1, ' ', '', 0, 0, 0, 16, 16, 1
At line 250 of file fanion_mt.F
Fortran runtime error: End of record

Error termination. Backtrace:
#0 0x2aaaaafd66d9 in write_decimal
at ../../../cray-gcc-6.3.0-201701050407.93fe37becc347/libgfortran/io/write.c:715
#1 0x2aaaaafcdc1c in formatted_transfer_scalar_write
at ../../../cray-gcc-6.3.0-201701050407.93fe37becc347/libgfortran/io/transfer.c:1775
#2 0x2aaaaafcdc1c in formatted_transfer
at ../../../cray-gcc-6.3.0-201701050407.93fe37becc347/libgfortran/io/transfer.c:2004
#3 0x201434fd in fanion_mt_
at /lus/snx11062/scratch/ms/es/sp5/hm_home/clim_38h1_knmi_iberia/lib/src/xrd/fa/mt/fanion_mt.F:250
#4 0x20132a41 in fanion_
at /lus/snx11062/scratch/ms/es/sp5/hm_home/clim_38h1_knmi_iberia/lib/src/xrd/fa/fanion.F:15
#5 0x200f21ee in fl_
at /lus/snx11062/scratch/ms/es/sp5/hm_home/clim_38h1_knmi_iberia/lib/util/gl/ala/fl.F90:260
#6 0x200f17dc in fa_or_lfi_
at /lus/snx11062/scratch/ms/es/sp5/hm_home/clim_38h1_knmi_iberia/lib/util/gl/ala/.fa_or_lfi.F90:35
#7 0x20038454 in gl
at /lus/snx11062/scratch/ms/es/sp5/hm_home/clim_38h1_knmi_iberia/lib/util/gl/prg/gl.F90:336
#8 0x20033686 in main
at /lus/snx11062/scratch/ms/es/sp5/hm_home/clim_38h1_knmi_iberia/lib/util/gl/prg/gl.F90:17

When gl arrives to the first TG1 variable it doesn't find the translation and it seems that crashes in the second (X002TG1).
Before the changes it worked as I copy below:

SFX.SIC > 001:091- 000-102@19900601_00:00+720h00m tri:000 000 SIC 0.000E+000 0.000E+000 0.000E+000 0.000E+000
SFX.SST > 001:011- 000-102@19900601_00:00+720h00m tri:000 000 SST 290.167E+000 293.872E+000 296.991E+000 2.169E+000
SFX.TS_WATER > 001:011- 770-105@19900601_00:00+720h00m tri:000 000 TS_WATER 287.072E+000 301.826E+000 310.447E+000 2.932E+000
SFX.T_WML > 19900601_00:00+720h00m 000 287.072E+000 301.826E+000 310.447E+000 2.932E+000
SFX.T_BOT > 19900601_00:00+720h00m 000 277.130E+000 282.671E+000 291.877E+000 2.978E+000
SFX.H_SNOW > 19900601_00:00+720h00m 000 0.000E+000 0.000E+000 0.000E+000 0.000E+000
SFX.H_ML > 19900601_00:00+720h00m 000 895.581E-003 1.512E+000 3.473E+000 368.023E-003
X001TG1 > 001:011- 800-105@19900601_00:00+720h00m tri:000 000 Surface temperature (isba 269.644E+000 288.241E+000 307.192E+000 5.672E+000
X002TG1 > 19900601_00:00+720h00m 000 272.984E+000 290.319E+000 307.938E+000 5.353E+000
X001TG2 > 001:011- 801-105@19900601_00:00+720h00m tri:000 000 Second soil temperature ( 273.107E+000 291.659E+000 308.582E+000 5.588E+000
X002TG2 > 19900601_00:00+720h00m 000 275.584E+000 292.285E+000 308.072E+000 5.265E+000
...

It only translated the first variable (X001TG1). The original line was like this:

trans_tab( i ) = trans('TG1 ',' ',' ',1,001,011,t%lev,105,0,'Surface temperature (isba)','')

The only difference is in the prefix XNNN. Is there a particular way of writing the variable name?

What can be the problem?

Thank you!

Juan Carlos

gl crashes after modifying trans_tab.h 1 year 3 months ago #2194

  • Ulf Andrae
  • Ulf Andrae's Avatar
  • OFFLINE
  • Administrator
  • Posts: 283
  • Thank you received: 30
Juan Carlos,

Can you please repeat your exercise with a harmonie-40h1.1.1 version of gl and report the outcome. I'm afraid that it's out of scope for me to debug cy38 as we are currently building cy43.

Ulf

gl crashes after modifying trans_tab.h 1 year 3 months ago #2195

  • Bert van Ulft
  • Bert van Ulft's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 98
  • Thank you received: 22
Hi Juan Carlos,

it seems support for two patches can be added to the HCLIM version by modifying util/gl/mod/module_fa_and_grib.F90
util/gl/mod/module_fa_and_grib.F90
205c205,206
<        full_name(1:4) == 'X001' ) THEN
---
>        full_name(1:4) == 'X001' .or. &
>        full_name(1:4) == 'X002' ) THEN
making it twice as good! Of course there are cleaner solution so it can also handle 3 etc patches.
After recompiling this shows grib codes for the X002* variables as well. So you shouldn't modify trans_tab.h at all, and leave all the X00* prefixes out. The disadvantage is that X001* and X002* get the same grib parameters, which causes an abort in gl. To work around this you could create one namelist for all X001 variables and one for all X002 variables. Or convert to netcdf.
If this solves your problem, perhaps we should commit it to the HCLIM38h1 branch in the repository.

best wishes,

Bert

gl crashes after modifying trans_tab.h 1 year 3 months ago #2196

  • Ulf Andrae
  • Ulf Andrae's Avatar
  • OFFLINE
  • Administrator
  • Posts: 283
  • Thank you received: 30
Juan Carlos, Bert,

Please note that I went in the opposite direction for the trunk today

hirlam.org/trac/changeset/17661

Ulf

gl crashes after modifying trans_tab.h 1 year 3 months ago #2198

  • Bert van Ulft
  • Bert van Ulft's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 98
  • Thank you received: 22
OK, then please try Ulf's solution first. The closer we stay to the trunk, the better. Note that David update gl in HCLIM to a 40'ish version not too long ago, so the differences shouldn't be too large.

best wishes,

Bert

gl crashes after modifying trans_tab.h 1 year 2 months ago #2201

Hi,

Thank you! I have tried the way proposed by Ulf. I have set up harmonie40h1.1.1, modified trans_tab.h and compiled and the gl generated works.
The only thing is that the variables with X001 prefix are not converted with the level number t%lev = 830 which appears at trans_table after the section 'ISBA - PATCH1' but with t%lev = 800 which appears after 'ISBA' section. However, the variables after the 'ISBA - PATCH2' section are translated according the t%lev=850 that I have used for them (I have changed t%lev=840 because I wanted to include the 14 levels of soil and 830 + 14 = 844, so that the space for PATCH2 was invaded). For example:

X001WG2 > 001:086- 801-105@19900101_00:00+000h00m tri:000 000 Root liq. vol. wat. cont. 1.000E-003 294.383E-003 449.388E-003 62.279E-003
X002WG2 > 001:086- 851-105@19900101_00:00+000h00m tri:000 000 Root liq. vol. wat. cont. 1.000E-003 295.364E-003 449.388E-003 61.839E-003

And also some variables which are in the PATCH1 section but not in the ISBA section are not translated:

X001PATCH > 19900101_00:00+000h00m 000 0.000E+000 744.892E-003 1.000E+000 200.141E-003
X002PATCH > 001:203- 850-105@19900101_00:00+000h00m tri:000 000 Patch fraction (0-1) 0.000E+000 255.108E-003 1.000E+000 200.141E-003

I don't know if this is the intended way or if it is an error in the translation.

Anyway, now I have a way to generate .grib from .fa with all the fields I wanted. Thank you!

The next step for me is to use fldextr_grib_api to generate vfld files in order to try to use the monitor to make a verification. (I have some problems and I will ask for help in another question that I'm going to post to the forum)

Cheers!

Juan Carlos.

gl crashes after modifying trans_tab.h 1 year 2 months ago #2202

  • Ulf Andrae
  • Ulf Andrae's Avatar
  • OFFLINE
  • Administrator
  • Posts: 283
  • Thank you received: 30
Juan Carlos,

Where can I find your modifications on ecgate?

As you notice there are room for improvements in the consistency of the SURFEX to GRIB translations....

Ulf

gl crashes after modifying trans_tab.h 1 year 2 months ago #2205

Hello Ulf,

The experiment path is: /home/ms/es/sp5/hm_home/harmonito_40h1_1_1 and the complete path to the trans_tab.h is /home/ms/es/sp5/hm_home/harmonito_40h1_1_1/util/gl/inc/trans_tab.h

I have given permissions to all the directories so that you can read and copy files.

Although 'there can be room for improvements', I'm not going to complain, on the contrary, I'm very grateful for all the work and improvements some people like you do ;)

Juan Carlos.
Time to create page: 0.088 seconds