The OASIS Coupler Forum

  HOME

WRIT, WTRN, WRST, KINF meaning

Up to Bugs and debugs

Posted by Anonymous at June 4 2014

Hi everybody New user of OASIS, I carefully read the debugging file ($NLOGPRT 1) to check the realized coupling. I have a few questions to get the meaning of the message. Here they are. The answers are probably quite simple from any advised developer. Let's start.

Below is the coupling definition in the namcouple for the Sea Surface Height variable:

MARS_SSH WW3__SSH 1 30 2 rstrt.nc EXPOUT
98 64 6435 1 ocnt ww3t LAG=+2
R  0  R  0
LOCTRANS SCRIPR
AVERAGE
DISTWGT LR SCALAR LATLON 1 4

2 models are coupled (MARS and WW3) during RUNTIME=150 and there is a LAG=+30 for MARS MARS_SSH variable. In debug.root.01, I can read some lines I would like to make sure I well understand :

#COMMENT 1 : restart files

--**** ENTER oasis_advance_init

oasis_advance_init Field cplid :           4 MARS_SSH
oasis_advance_init lag prism_ncoupler :          2          18
----**** ENTER oasis_advance_run
oasis_advance_run  at          -2           0  RRST: MARS_SSH rstrt.nc
------**** ENTER /EXIT oasis_io_read_avfile
------**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av2_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
------**** EXIT  oasis_io_read_avfile
------**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av3_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
------**** EXIT  oasis_io_read_avfile
------**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av4_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
------**** EXIT  oasis_io_read_avfile
------**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av5_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
------**** EXIT  oasis_io_read_avfile
oasis_advance_run  at          -2           0  PACK: MARS_SSH instant
oasis_advance_run  at          -2           0  SEND: MARS_SSH
------**** ENTER/EXIT oasis_advance_map
oasis_advance_run  at          -2           0  WRIT: MARS_SSH
------**** ENTER/EXIT oasis_io_write_avfbf
oasis_advance_run  at          -2           0  KINF: MARS_SSH           8
----**** EXIT  oasis_advance_run

KINF ? and to what number 8 is relative to ? Actually is there a list of the meaning of the different values of KINF ?

# COMMENT 2 : loctrans field and files

oasis_advance_init Field cplid :           4 MARS_SSH
oasis_advance_init at            0           0  RTRN: MARS_SSH rstrt.nc
----**** ENTER oasis_io_read_array
oasis_io_read_array:loc02_cnt:NetCDF: Variable not found
oasis_io_read_array model :           1  proc :           0
------**** ENTER/EXIT oasis_mpi_bcasti1
----**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:loc02_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
----**** EXIT  oasis_io_read_avfile
----**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av2loc02_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
----**** EXIT  oasis_io_read_avfile
----**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av3loc02_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
----**** EXIT  oasis_io_read_avfile
----**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av4loc02_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
----**** EXIT  oasis_io_read_avfile
----**** ENTER oasis_io_read_avfile
oasis_io_read_avfile:av5loc02_MARS_SSH:NetCDF: Variable not found
oasis_io_read_avfile model :           1  proc :           0
----**** EXIT  oasis_io_read_avfile

--**** EXIT  oasis_advance_init
oasis_enddef done prism_advance_init

I suspect, I should not worry about that. But is someone might briefly explain what do the messages mean, especially av2, av3... ?

#COMMENT 3 : run

**** ENTER oasis_put_r28
--**** ENTER oasis_advance_run
oasis_advance_run  at           118         120  PACK: MARS_SSH average
oasis_advance_run  at           118         120  SEND: MARS_SSH
----**** ENTER/EXIT oasis_advance_map
oasis_advance_run  at           118         120  WRIT: MARS_SSH
----**** ENTER/EXIT oasis_io_write_avfbf
----**** ENTER/EXIT oasis_io_write_array
----**** ENTER/EXIT oasis_io_write_avfile
oasis_advance_run  at           118         120  WTRN: MARS_SSH rstrt.nc
oasis_advance_run  at           118         120  KINF: MARS_SSH           8
--**** EXIT  oasis_advance_run
**** EXIT  oasis_put_r28

What is the meaning of PACK: add and average the current ssh field to end the time average ?

SEND : I understand that MARS model is sending the SSH field (that has been averaged over the previous period) to model 2 because 120 is a multiple of the coupling period 30

What is the meaning of WRIT (write?) : SSH variable is saved, and erases the previous time averaged in order to start a new period of average ?

What is the meaning of WTRN (Write To Restart file the Next field to be called from a future simulation ?) : the ssh var is saved in the restart file named rstrt.nc ?

# COMMENT 4 : end of the run

**** ENTER oasis_put_r28
--**** ENTER oasis_advance_run
oasis_advance_run  at          148         150  PACK: MARS_SSH average
----**** ENTER/EXIT oasis_io_write_avfile
oasis_advance_run  at          148         150  WRST: MARS_SSH rstrt.nc
oasis_advance_run  at          148         150  WRIT: MARS_SSH
----**** ENTER/EXIT oasis_io_write_avfbf
----**** ENTER/EXIT oasis_io_write_array
----**** ENTER/EXIT oasis_io_write_avfile
oasis_advance_run  at          148         150  WTRN: MARS_SSH rstrt.nc
oasis_advance_run  at          148         150  KINF: MARS_SSH           9
--**** EXIT  oasis_advance_run
**** EXIT  oasis_put_r28

(oasis_terminate) SUCCESSFUL RUN
-- EXIT  (oasis_terminate)

What is the meaning of WRST (real? Write to ReStarT file) : the field is effectively updated in the restart file while with WTRN, OASIS was saving its value without any writing in the rstrt.nc file ?

 

Thank you very much for your answer

Valérie

Posted by Anonymous at June 11 2014

Hi Valerie,

COMMENT #1 and #2:

In oasis_advance_init, the restart fields and the LOCTRANS restart fields are read from the restart file (see the User Guide https://oasis.cerfacs.fr/wp-content/uploads/sites/114/2021/02/GLOBC-Valcke_TR_OASIS3-MCT_2.0_2013.pdf, section 4.1). This routine is called in oasis_enddef.

RRST means that you read the restart field MARS_SSH in the restart file rstrt.nc (LAG=2 and -2+2=0 the first coupling time step). As there are 4 more optional arguments in the oasis_put routine, there can be 4 restart fields in the restart file corresponding to the av*_* fields. It is not necessary that they are in the restart file for the first run.
Then PACK means that the field, transformed following the LOCTRANS operation, is ready to be sent, SEND means that the fileds was sent.
If the field is defined with EXPOUT (or OUTPUT) in the namcouple it will be written in a debug file, before and after interpolation for EXPOUT, and that corresponds to WRIT.
To end with, KINF, which means KINFO, is an integer giving information on the status of the field. Here, 8 means OASIS_SentOut, ie written to an output debug file and sent to another model. The signification of all the possible values of KINF (=info) of oasis_put is given in the User Guide https://oasis.cerfacs.fr/wp-content/uploads/sites/114/2021/02/GLOBC-Valcke_TR_OASIS3-MCT_2.0_2013.pdf, section 2.7.1 .

In the model 2, that begins its coupling with an oasis_get, the field MARS_SSH will be available as it is sent by model 1 in oasis_enddef.

In OASIS3-MCT, the LOCTRANS operation uses also restart fields that are written in the restart file rstrt.nc. That corresponds to RTRN. Again, as there are five arguments in oasis_put, there can be 5 LOCTRANS restart fields in the file rstrt.nc. They corresponds to the loc02_MARS_SSH and av*loc02_* It is not necessary that they are present in the restart file for the first run if they are not used or if they are used in the simulation, but if they are used they will be written at the end of each run.

COMMENT #3

118+2=120 wich is a multiple of the coupling period so the field will be sent to model2.

I already answer most of your questions corresponding to COMMENT #3 in COMMENT #1 and #2. WTRN means that the LOCTRANS restart field is written into the restart file rstrt.nc overwritten the last value of this field.

COMMENT #4

148+2=150 = RUNTIME of your namcouple. This is the end of the simulation.

The field will not be sent to model 2 but will be written in the restart file rstrt.nc as indicated by WRST. The LOCTRANS restart field will also be written in the restart file rstrt.nc (WTRN).

Best regards, Laure

Posted by Anonymous at June 17 2014

Hi Laure and thank you very much for your clear answers. Regarding the order of the messages in the debug files, I wonder at which time step the time average of the fields starts exactly.

1/ During the simulation (coupling time = 30s, time step of the model = 2s), one can read

oasis_advance_run  at  28   30  PACK: MARS_SSH average
oasis_advance_run  at  28   30  SEND: MARS_SSH
oasis_advance_run  at  28   30  WRIT: MARS_SSH
oasis_advance_run  at  28   30  KINF: MARS_SSH   8

It suggests to me the LOCTRANS (time average) is ending at t=28 (and uses the value of the field at t=28). Then, the field is sent to the other model. Consequently, for the next period, the time average will run from t=30 to t=58s ([30-58] interval).

2/ At the end of the run WTRN appears at the first time for t=568 :

oasis_advance_run  at  568   570  PACK: MARS_SSH average
oasis_advance_run  at  568   570  SEND: MARS_SSH
oasis_advance_run  at  568   570  WRIT: MARS_SSH
oasis_advance_run  at  568   570  WTRN: MARS_SSH rstrt.nc
oasis_advance_run  at  568   570  KINF: MARS_SSH  8

The time integration is done during the coupling period (for instance)
oasis_advance_run  at   576   578  PACK: MARS_SSH average
oasis_advance_run  at   576   578  WTRN: MARS_SSH rstrt.nc
oasis_advance_run  at   576   578  KINF: MARS_SSH  5

And eventually, one get at the end of the simulation
oasis_advance_run  at   598   600  PACK: MARS_SSH average
oasis_advance_run  at   598   600  WRST: MARS_SSH rstrt.nc
oasis_advance_run  at   598   600  WRIT: MARS_SSH
oasis_advance_run  at   598   600  WTRN: MARS_SSH rstrt.nc
oasis_advance_run  at   598   600  KINF: MARS_SSH  9

These messages suggest to me, that :

a- for the field in the restart file, the time integration is estimated from t=568 to t=596 (and not t=598 because WRST is before WTRN)

b - the field is saved in the restart file at=598 (WRST)

c - The initialization of the next time period average is done at t=598 (WTRN)

But finally, I am probably wrong somewhere because, to summarize, I conclude that time average is done over the period : - [0-28], [30-58],... [120-148] ... ,[570-598] for the exchanges between models but - [568-596] for the fields in the restart file (I mean MARS_SSH and loc02_MARS_SSH) Where am I wrong and what am I missing ?

Second question (that might put into light my mistake) : In the restart file, is there a link between MARS_SSH variable and LOC02_MARS_SSH ? From my readings I have concluded that at the time coupling for the restart file, MARS_SSH=LOC02_MARS_SSH (WRST) and LOC02_MARS_SSH=??? O? If they have no link, what are LOC02_MARS_SSH variables ? They are not intermediate fields to estimate LOC00_MARS_SSH (LOCTRANS = INSTANT) LOC01_MARS_SSH (LOCTRANS = ACCUMUL) LOC02_MARS_SSH (LOCTRANS = AVERAGE) LOC03_MARS_SSH (LOCTRANS = T_MIN) LOC04_MARS_SSH (LOCTRANS = T_MAX) ? If not what are they ?

Thank you very much. Hoping I am not disturbing the other OASIS users... Valérie

Posted by Anonymous at June 27 2014

Hi Valerie,

The loctrans restart mecanism is a little bit different from the restart (LAG > 0) mecanism. Indeed the restart field you save in your restart file is the accumulated or averaged field that you would have sent if the run did not end.

For the LOCTRANS, it is different, at some point the restart field is saved but its value changes (the field is overwritten) in the restart file until the run ends. Figures LOCTRANS_fig1.pdf (https://oasis.cerfacs.fr/wp-content/uploads/sites/114/2021/07/LOCTRANS_fig1.pdf), LOCTRANS_fig2.pdf (https://oasis.cerfacs.fr/wp-content/uploads/sites/114/2021/07/LOCTRANS_fig2.pdf), LOCTRANS_fig3.pdf (https://oasis.cerfacs.fr/wp-content/uploads/sites/114/2021/07/LOCTRANS_fig3.pdf) explain what is happening for LOCTRANS restarts with and without LAG.

Finally, concerning your last question, LOC02_MARS_SSH corresponds to the LOCTRANS restart field and as you observe, 02,03,04 corresponds to the transformation you are asking.

Best regards, Laure
Reply to this