Changeset 8531 for branches/ORCHIDEE_2_2


Ignore:
Timestamp:
2024-04-15T11:23:37+02:00 (9 months ago)
Author:
josefine.ghattas
Message:

Integrated [7912], [7925], [8179] and [8412] done on the trunk to output forcing file that can be used in offline mode. See ticket #899

Location:
branches/ORCHIDEE_2_2/ORCHIDEE
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_driver/forcing_tools.f90

    r7901 r8531  
    44844484  REAL(r_std), ALLOCATABLE, DIMENSION(:,:,:) :: tmp_slab2d 
    44854485  CHARACTER(LEN=80) :: name 
     4486  CHARACTER(LEN=80) :: coordinates ! temporary variable for attribut coordinates 
    44864487  LOGICAL :: windzero 
    44874488  ! 
     
    45444545     iret = NF90_GET_ATT(force_id(fileindex), varid, 'cell_methods', cellmethod) 
    45454546     IF (iret /= NF90_NOERR) THEN 
    4546         ! If the attribute is not found then we set a reasonable default : instantaneous and centered. 
    4547         cellmethod="time: instantaneous" 
     4547        ! If the attribute is not found then we set undefined 
     4548        cellmethod="undefined" 
    45484549     ENDIF 
     4550 
     4551     ! Read also attribute coordinates that might contain information about the name of the time axis. 
     4552     ! If the forcing file is produced by XIOS, this is the case. 
     4553     ! Reading of the time axis name can fail if the attribute coordinates contains something else than the time axis name. 
     4554     iret = NF90_GET_ATT(force_id(fileindex), varid, 'coordinates', coordinates) 
     4555     IF (iret == NF90_NOERR) THEN 
     4556        ! The attribute 'coordinates' was found. This is probably containg the name of the time axis.  
     4557        ! We add this information in the begining of the celllmethod variable. 
     4558        cellmethod=TRIM(coordinates)//":"//TRIM(cellmethod) 
     4559     ENDIF 
     4560 
    45494561     ! 
    45504562     ! 
     
    46454657  ENDDO 
    46464658  ! 
    4647   ! Go through all the time axes we have to find the right one. 
     4659  ! Go through all the time axes we have to find the right one based on the information 
     4660  ! read from attribute cell_methods or coordinates 
    46484661  ! 
    46494662  timeindex=0 
     
    46824695           ENDDO 
    46834696           ! 
    4684            ! If there is no "(" then we have to find the centered axis. 
    46854697        ELSE  
     4698           ! There is no "(" so we set the centered axis by defaut 
    46864699           DO im=1,nbtmethods 
    46874700              IF ( INDEX(time_cellmethod(itbase+im), "cent") > 0 ) THEN 
     
    46914704        ENDIF 
    46924705        ! 
    4693         ! The name of the time axis was found bu no method could be identified 
     4706        ! The name of the time axis was found but no method could be identified 
    46944707        ! 
    46954708        IF ( timeindex < 1 ) THEN 
     
    47024715     ENDIF 
    47034716  ENDDO 
    4704   ! 
    4705   ! Should no corresponding time axis name be found,  
    4706   ! then we use the first centered one. 
    4707   ! 
    4708   itax=1 
    4709   DO WHILE ( timeindex < 1 )  
    4710      IF ( INDEX(time_cellmethod(itax), "cent") > 0 ) THEN 
    4711         timeindex = itax 
    4712      ELSE 
    4713         itax = itax + 1 
    4714      ENDIF 
    4715   ENDDO 
    4716   ! 
     4717 
     4718 
     4719  ! 
     4720  ! If still no corresponding time axis name has be found, then we use the first centered one. 
     4721  ! This is the case if none of the attributes cell_methods or coordinates were found or if they  
     4722  ! didn't include the name of the corresponding time axis. 
     4723  IF ( timeindex < 1 ) THEN 
     4724     CALL ipslerr(2,'forcing_attributetimeaxe',& 
     4725          'No information about the name of the time axis was found in the attributes cell_method or coordinantes', & 
     4726          'The first centered time axis will be used as defaut.', & 
     4727          'Attribute coordinates is optional but must not contain something else than the name of the time axis.') 
     4728     itax=1 
     4729     DO WHILE ( timeindex < 1 )  
     4730        IF ( INDEX(time_cellmethod(itax), "cent") > 0 ) THEN 
     4731           timeindex = itax 
     4732        ELSE 
     4733           itax = itax + 1 
     4734        ENDIF 
     4735     ENDDO 
     4736  END IF 
     4737   
    47174738END SUBROUTINE forcing_attributetimeaxe 
    47184739 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_sechiba/sechiba.f90

    r8462 r8531  
    739739    IF (printlev_loc>=3) WRITE(numout,*) 'Start sechiba_main kjpindex =',kjpindex 
    740740 
     741    CALL xios_orchidee_send_field("nav_lat",lalo(:,1)) 
     742    CALL xios_orchidee_send_field("nav_lon",lalo(:,2)) 
     743 
    741744    !! 1. Initialize variables at each time step 
    742745    CALL sechiba_var_init (kjpindex, rau, pb, temp_air)  
     
    10551058    CALL xios_orchidee_send_field("roughheight",roughheight) 
    10561059    CALL xios_orchidee_send_field("lai",lai) 
     1060    CALL xios_orchidee_send_field("u",u) 
     1061    CALL xios_orchidee_send_field("v",v) 
     1062    CALL xios_orchidee_send_field("zlev",zlev) 
     1063 
    10571064    histvar(:)=zero    
    10581065    DO ji = 1, kjpindex 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/field_def_orchidee.xml

    r8468 r8531  
    3333 
    3434  <field_group id="sechiba" grid_ref="grid_landpoints"> 
     35    <field id="nav_lon" name="nav_lon" long_name="Longitudes" unit="deg" operation="once" /> 
     36    <field id="nav_lat" name="nav_lat" long_name="Latitudes" unit="deg" operation="once" /> 
    3537    <field id="areas" name="Areas" long_name="Mesh areas" unit="m2" operation="once" freq_offset="0ts" /> 
    3638    <field id="LandPoints" name="LandPoints" long_name="Land Points" unit="1" operation="once" freq_offset="0ts"/> 
     
    6567    <field id="precip_rain" name="precip_rain" long_name="Rainfall rate" unit="mm/s"/> 
    6668    <field id="precip_snow" name="precip_snow" long_name="Snowfall rate" unit="mm/s"/> 
     69    <field id="u" name="u" long_name="Wind speed north-south" unit="m/s"/> 
     70    <field id="v" name="v" long_name="Wind speed east-west" unit="m/s"/> 
     71    <field id="zlev" name="zlev" long_name="Height of the lowest level of the atmospheric model" unit="m"/> 
    6772    <field id="netrad" name="netrad" long_name="Net radiation" unit="W/m^2"/> 
    6873    <field id="lai" name="lai" long_name="Leaf Area Index per PFT" unit="1" grid_ref="grid_nvm"/> 
  • branches/ORCHIDEE_2_2/ORCHIDEE/src_xml/file_def_orchidee.xml

    r8468 r8531  
    738738  </file> 
    739739 
    740   <!-- Sechiba file 4 containing variables read and interpolated from input files --> 
    741   <file id="sechiba4" name="sechiba_interp_diag" output_level="1" output_freq="1d" enabled=".TRUE."> 
     740  <!-- This file is written in the begining of the execution. The variables are written only once. --> 
     741  <file id="sechiba4" name="ORCHIDEE_interp_diag" output_level="3" output_freq="1d" enabled=".FALSE."> 
    742742    <field_group id="groupremap_sechiba4" group_ref="remap_1d" grid_ref="grid_landpoints_out" > 
    743743 
     
    10011001     
    10021002  </file> 
     1003 
     1004 
     1005  <!-- ORCHIDEE offline forcing file --> 
     1006 
     1007  <!-- This is a file that can be used as a forcing file for ORCHIDEE offline simualtions --> 
     1008  <file id="forcing_by_ORCHIDEE" name="forcing_by_ORCHIDEE" output_level="1" output_freq="3h" enabled=".FALSE."> 
     1009   <field_group id="groupremap_forcing" group_ref="remap_3h" grid_ref="grid_landpoints_out" > 
     1010 
     1011    <!-- level 1 --> 
     1012    <field field_ref="contfrac" level="1"/> 
     1013    <field field_ref="nav_lon" level="1"/> 
     1014    <field field_ref="nav_lat" level="1"/> 
     1015    <field field_ref="areas" level="1"/> 
     1016    <field field_ref="temp_air" name="Tair" operation="instant" level="1"/> 
     1017    <field field_ref="pb" name="PSurf" operation="instant" level="1"/> 
     1018    <field field_ref="qair" name="Qair" operation="instant" level="1"/> 
     1019    <field field_ref="u" name="Wind_N" operation="instant" level="1"/> 
     1020    <field field_ref="v" name="Wind_E" operation="instant" level="1"/> 
     1021    <field field_ref="zlev" name="Levels" operation="instant" level="1"/> 
     1022    <field field_ref="precip_rain" name="Rainf" level="1"/> 
     1023    <field field_ref="precip_snow" name="Snowf" level="1"/> 
     1024    <field field_ref="lwdown" name="LWdown" level="1"/> 
     1025    <field field_ref="swdown" name="SWdown" level="1"/> 
     1026   </field_group>   
     1027  </file> 
     1028 
     1029 
    10031030</file_definition> 
Note: See TracChangeset for help on using the changeset viewer.