Opened 4 years ago

Closed 4 years ago

#602 closed enhancement (fixed)

error message when the date is bigger in the restart rather than in the forcing file

Reported by: ajornet Owned by: somebody
Priority: minor Milestone: ORCHIDEE 3.0
Component: Driver files Version: trunc
Keywords: dim2_driver date forcing_file restart Cc:

Description

According to the Orchidee code, the date found in the restart (date0_rest) file must be bigger or equal to the forcing file (date0)
.
If it's not the case the error below shows up:

 786     it_force = it+for_offset
 787     IF (it_force < 0) THEN
 788       WRITE(numout,*) 'The day is not in the forcing file :', &
 789  &               it_force, it, for_offset
 790       CALL ipslerr_p(3,'dim2_driver','Pb in forcing file','','')

because for_offset gets a negative values:

 490   IF (date0 /= date0_rest) THEN
 491     WRITE(numout,*) 'date0_rest , date0 : ',date0_rest , date0
 492     for_offset = NINT((date0_rest-date0)*one_day/dt_force)
 493   ELSE
 494     for_offset = 0
 495   ENDIF

As a given example:

date0_rest , date0 :    731095.000000000        732190.000000000
OFFSET FOR THE data read :       -4380
...
The day is not in the forcing file :       -2919        1461       -4380

The error shown above does not properly describe the real problem. That's the purpose of the modification shown below:

[ajornet@obelix3 MICT_LATEST]$ svn diff
Index: src_driver/dim2_driver.f90
===================================================================
--- src_driver/dim2_driver.f90	(révision 6235)
+++ src_driver/dim2_driver.f90	(copie de travail)
@@ -90,7 +90,8 @@
 
   CHARACTER(LEN=512) :: filename, driv_restname_in, driv_restname_out
   CHARACTER(LEN=30) :: time_str, var_name
-
+  CHARACTER(LEN=100) :: str, str1 ! temporary variables to print data
+!-
   INTEGER :: it, istp, istp_old, rest_id, it_force
 
   INTEGER :: split, split_start, nb_spread, for_offset
@@ -490,9 +491,15 @@
 ! Same things if the starting dates are not the same.
 ! Everything should look as if we had only one forcing file !
 !-
-  IF (date0 /= date0_rest) THEN
+  IF (date0 .lt. date0_rest) THEN
     WRITE(numout,*) 'date0_rest , date0 : ',date0_rest , date0
     for_offset = NINT((date0_rest-date0)*one_day/dt_force)
+  ELSE IF (date0 .gt. date0_rest) THEN
+    write(str,*) "date0=", date0
+    write(str1,*) "date0_rest=", date0_rest
+    CALL ipslerr_p(3, 'dim2_driver', &
+            'restart date (date0_rest) must be bigger or equal than the forcing file date (date0)',&
+            trim(str),trim(str1))
   ELSE
     for_offset = 0
   ENDIF

Expected error message:

FATAL ERROR FROM ROUTINE dim2_driver
 --> restart date (date0_rest) must be bigger or equal than the forcing file date (date0)
 -->  date0=   732190.000000000
 -->  date0_rest=   731095.000000000

Change History (2)

comment:2 Changed 4 years ago by ajornet

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.