Changeset 8038


Ignore:
Timestamp:
2017-05-18T10:43:31+02:00 (3 years ago)
Author:
andmirek
Message:

No need to define restart file and fields in restart file in iodef.xml. see MO u-al584 for details. Add namelist variable in reference namelist, and new context definition/grid and domain definitions in gyre configuration.

Location:
branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/domain_def.xml

    r6499 r8038  
    191191   </domain>   
    192192 
     193     <domain_group id="grid_N"> 
     194      <domain id="grid_N" long_name="grid nomask"/> 
     195     </domain_group> 
    193196 
    194197   </domain_definition>     
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/iodef.xml

    r6487 r8038  
    7979  </context> 
    8080   
     81  <context id="nemo_rst" > 
     82 
     83   <domain_definition src="./domain_def.xml"/> 
     84 
     85   <grid_definition> 
     86     <grid id="grid_T_2D" > 
     87       <domain id="grid_T" /> 
     88     </grid> 
     89     <grid id="grid_T_3D" > 
     90       <domain id="grid_T" /> 
     91       <axis id="deptht" /> 
     92     </grid> 
     93     <grid id="grid_U_2D" > 
     94       <domain id="grid_U" /> 
     95     </grid> 
     96     <grid id="grid_U_3D" > 
     97       <domain id="grid_U" /> 
     98       <axis id="depthu" /> 
     99     </grid> 
     100     <grid id="grid_V_2D" > 
     101       <domain id="grid_V" /> 
     102     </grid> 
     103     <grid id="grid_V_3D" > 
     104       <domain id="grid_V" /> 
     105       <axis id="depthv" /> 
     106     </grid> 
     107     <grid id="grid_W_2D" > 
     108       <domain id="grid_W" /> 
     109     </grid> 
     110     <grid id="grid_W_3D" > 
     111       <domain id="grid_W" /> 
     112       <axis id="depthw" /> 
     113     </grid> 
     114     <grid id="scalarpoint" /> 
     115 
     116     <grid id="Vgrid"> 
     117       <domain domain_ref="ptr" /> 
     118       <axis axis_ref="deptht" /> 
     119     </grid> 
     120 
     121     <grid id="grid_N" > 
     122       <domain domain_ref="grid_N" /> 
     123     </grid> 
     124     <grid id="grid_N_3D" > 
     125       <domain domain_ref="grid_N" /> 
     126       <axis axis_ref="deptht" /> 
     127     </grid> 
     128 
     129    </grid_definition> 
     130 
     131  </context> 
    81132 
    82133  <context id="xios"> 
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/CONFIG/SHARED/namelist_ref

    r7923 r8038  
    5050   ln_clobber  = .false.   !  clobber (overwrite) an existing file 
    5151   nn_chunksz  =       0   !  chunksize (bytes) for NetCDF file (works only with iom_nf90 routines) 
     52   ln_xios_read = .FALSE.  !  use XIOS to read restart file (only for a single file restart) 
    5253/ 
    5354! 
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r8014 r8038  
    260260!set names for variables in restart file 
    261261 
    262         rst_fields(:)="NO_NAME" 
    263  
    264         rst_fields(1)="rdt" 
    265         rst_fields(2)="rdttra1" 
    266         rst_fields(3)="un" 
    267         rst_fields(4)="ub" 
    268         rst_fields(5)="vn" 
    269         rst_fields(6)="vb" 
    270         rst_fields(7)="tn" 
    271         rst_fields(8)="tb" 
    272         rst_fields(9)="sn" 
    273         rst_fields(10)="sb" 
    274         rst_fields(11)="sshn" 
    275         rst_fields(12)="sshb" 
    276         rst_fields(13)="hdivn" 
    277         rst_fields(14)="hdivb" 
    278         rst_fields(15)="rhop" 
    279         rst_fields(16)="rotn" 
    280         rst_fields(17)="rotb" 
    281         rst_fields(18)="kt" 
    282         rst_fields(19)="ndastp" 
    283         rst_fields(20)="adatrj" 
    284         rst_fields(21)="utau_b" 
    285         rst_fields(22)="vtau_b" 
    286         rst_fields(23)="qns_b" 
    287         rst_fields(24)="emp_b" 
    288         rst_fields(25)="sfx_b" 
    289         rst_fields(26)="en"  
    290         rst_fields(27)="avt" 
    291         rst_fields(28)="avm" 
    292         rst_fields(29)="avmu" 
    293         rst_fields(30)="avmv" 
    294         rst_fields(31)="dissl" 
    295         rst_fields(32)="sbc_hc_b" 
    296         rst_fields(33)="sbc_sc_b" 
    297         rst_fields(34)="qsr_hc_b" 
    298         rst_fields(35)="gcx" 
    299         rst_fields(36)="gcxb" 
    300         rst_fields(37)="fraqsr_1lev" 
    301         rst_fields(38)="greenland_icesheet_mass" 
    302         rst_fields(39)="greenland_icesheet_timelapsed" 
    303         rst_fields(40)="greenland_icesheet_mass_roc" 
    304         rst_fields(41)="antarctica_icesheet_mass" 
    305         rst_fields(42)="antarctica_icesheet_timelapsed" 
    306         rst_fields(43)="antarctica_icesheet_mass_roc" 
    307         rst_fields(44)="rhd" 
    308         rst_fields(45)="frc_v" 
    309         rst_fields(46)="frc_t" 
    310         rst_fields(47)="frc_s" 
    311         rst_fields(48)="frc_wn_t" 
    312         rst_fields(49)="frc_wn_s" 
    313         rst_fields(50)="ssh_ini" 
    314         rst_fields(51)="e3t_ini" 
    315         rst_fields(52)="hc_loc_ini" 
    316         rst_fields(53)="sc_loc_ini" 
    317         rst_fields(54)="ssh_hc_loc_ini" 
    318         rst_fields(55)="ssh_sc_loc_ini" 
    319         rst_fields(56)="fse3t_b" 
    320         rst_fields(57)="fse3t_n" 
    321         rst_fields(58)="tilde_e3t_b" 
    322         rst_fields(59)="tilde_e3t_n" 
    323         rst_fields(60)="hdiv_lf" 
    324         rst_fields(61)="ub2_b" 
    325         rst_fields(62)="vb2_b" 
    326         rst_fields(63)="sshbb_e" 
    327         rst_fields(64)="ubb_e" 
    328         rst_fields(65)="vbb_e" 
    329         rst_fields(66)="sshb_e" 
    330         rst_fields(67)="ub_e" 
    331         rst_fields(68)="vb_e" 
    332         rst_fields(69)="fwf_isf_b" 
    333         rst_fields(70)="isf_sc_b" 
    334         rst_fields(71)="isf_hc_b" 
    335         rst_fields(72)="ssh_ibb" 
    336         rst_fields(73)="rnf_b" 
    337         rst_fields(74)="rnf_hc_b" 
    338         rst_fields(75)="rnf_sc_b" 
    339         rst_fields(76)="nn_fsbc" 
    340         rst_fields(77)="ssu_m" 
    341         rst_fields(78)="ssv_m" 
    342         rst_fields(79)="sst_m" 
    343         rst_fields(80)="sss_m" 
    344         rst_fields(81)="ssh_m" 
    345         rst_fields(82)="e3t_m" 
    346         rst_fields(83)="frq_m" 
    347         rst_fields(84)="avmb" 
    348         rst_fields(85)="avtb" 
     262        rst_fields(:)%vname="NO_NAME";         rst_fields(:)%grid="NO_GRID" 
     263 
     264        rst_fields(1)%vname="rdt";             rst_fields(1)% grid="grid_scalar" 
     265        rst_fields(2)%vname="rdttra1";         rst_fields(2)% grid="grid_scalar"       
     266        rst_fields(3)%vname="un";              rst_fields(3)% grid="grid_N_3D" 
     267        rst_fields(4)%vname="ub";              rst_fields(4)% grid="grid_N_3D" 
     268        rst_fields(5)%vname="vn";              rst_fields(5)% grid="grid_N_3D" 
     269        rst_fields(6)%vname="vb";              rst_fields(6)% grid="grid_N_3D"   
     270        rst_fields(7)%vname="tn";              rst_fields(7)% grid="grid_N_3D" 
     271        rst_fields(8)%vname="tb";              rst_fields(8)% grid="grid_N_3D" 
     272        rst_fields(9)%vname="sn";              rst_fields(9)% grid="grid_N_3D" 
     273        rst_fields(10)%vname="sb";             rst_fields(10)%grid="grid_N_3D" 
     274        rst_fields(11)%vname="sshn";           rst_fields(11)%grid="grid_N" 
     275        rst_fields(12)%vname="sshb";           rst_fields(12)%grid="grid_N" 
     276        rst_fields(13)%vname="hdivn";          rst_fields(13)%grid="grid_N_3D" 
     277        rst_fields(14)%vname="hdivb";          rst_fields(14)%grid="grid_N_3D" 
     278        rst_fields(15)%vname="rhop";           rst_fields(15)%grid="grid_N_3D" 
     279        rst_fields(16)%vname="rotn";           rst_fields(16)%grid="grid_N_3D" 
     280        rst_fields(17)%vname="rotb";           rst_fields(17)%grid="grid_N_3D" 
     281        rst_fields(18)%vname="kt";             rst_fields(18)%grid="grid_scalar" 
     282        rst_fields(19)%vname="ndastp";         rst_fields(19)%grid="grid_scalar" 
     283        rst_fields(20)%vname="adatrj";         rst_fields(20)%grid="grid_scalar" 
     284        rst_fields(21)%vname="utau_b";         rst_fields(21)%grid="grid_N" 
     285        rst_fields(22)%vname="vtau_b";         rst_fields(22)%grid="grid_N" 
     286        rst_fields(23)%vname="qns_b";          rst_fields(23)%grid="grid_N" 
     287        rst_fields(24)%vname="emp_b";          rst_fields(24)%grid="grid_N" 
     288        rst_fields(25)%vname="sfx_b";          rst_fields(25)%grid="grid_N" 
     289        rst_fields(26)%vname="en" ;            rst_fields(26)%grid="grid_N_3D"  
     290        rst_fields(27)%vname="avt";            rst_fields(27)%grid="grid_N_3D" 
     291        rst_fields(28)%vname="avm";            rst_fields(28)%grid="grid_N_3D" 
     292        rst_fields(29)%vname="avmu";           rst_fields(29)%grid="grid_N_3D" 
     293        rst_fields(30)%vname="avmv";           rst_fields(30)%grid="grid_N_3D" 
     294        rst_fields(31)%vname="dissl";          rst_fields(31)%grid="grid_N_3D" 
     295        rst_fields(32)%vname="sbc_hc_b";       rst_fields(32)%grid="grid_N" 
     296        rst_fields(33)%vname="sbc_sc_b";       rst_fields(33)%grid="grid_N" 
     297        rst_fields(34)%vname="qsr_hc_b";       rst_fields(34)%grid="grid_N_3D" 
     298        rst_fields(35)%vname="gcx";            rst_fields(35)%grid="grid_N" 
     299        rst_fields(36)%vname="gcxb";           rst_fields(36)%grid="grid_N" 
     300        rst_fields(37)%vname="fraqsr_1lev";    rst_fields(37)%grid="grid_N" 
     301        rst_fields(38)%vname="greenland_icesheet_mass" 
     302                                               rst_fields(38)%grid="grid_scalar" 
     303        rst_fields(39)%vname="greenland_icesheet_timelapsed" 
     304                                               rst_fields(39)%grid="grid_scalar" 
     305        rst_fields(40)%vname="greenland_icesheet_mass_roc" 
     306                                               rst_fields(40)%grid="grid_scalar" 
     307        rst_fields(41)%vname="antarctica_icesheet_mass" 
     308                                               rst_fields(41)%grid="grid_scalar" 
     309        rst_fields(42)%vname="antarctica_icesheet_timelapsed" 
     310                                               rst_fields(42)%grid="grid_scalar" 
     311        rst_fields(43)%vname="antarctica_icesheet_mass_roc" 
     312                                               rst_fields(43)%grid="grid_scalar" 
     313        rst_fields(44)%vname="rhd";            rst_fields(44)%grid="grid_N_3D" 
     314        rst_fields(45)%vname="frc_v";          rst_fields(45)%grid="grid_scalar" 
     315        rst_fields(46)%vname="frc_t";          rst_fields(46)%grid="grid_scalar" 
     316        rst_fields(47)%vname="frc_s";          rst_fields(47)%grid="grid_scalar" 
     317        rst_fields(48)%vname="frc_wn_t";       rst_fields(48)%grid="grid_scalar" 
     318        rst_fields(49)%vname="frc_wn_s";       rst_fields(49)%grid="grid_scalar" 
     319        rst_fields(50)%vname="ssh_ini";        rst_fields(50)%grid="grid_N" 
     320        rst_fields(51)%vname="e3t_ini";        rst_fields(51)%grid="grid_N_3D" 
     321        rst_fields(52)%vname="hc_loc_ini";     rst_fields(52)%grid="grid_N_3D" 
     322        rst_fields(53)%vname="sc_loc_ini";     rst_fields(53)%grid="grid_N_3D" 
     323        rst_fields(54)%vname="ssh_hc_loc_ini"; rst_fields(54)%grid="grid_N" 
     324        rst_fields(55)%vname="ssh_sc_loc_ini"; rst_fields(55)%grid="grid_N" 
     325        rst_fields(56)%vname="fse3t_b";        rst_fields(56)%grid="grid_N_3D" 
     326        rst_fields(57)%vname="fse3t_n";        rst_fields(57)%grid="grid_N_3D" 
     327        rst_fields(58)%vname="tilde_e3t_b";    rst_fields(58)%grid="grid_N" 
     328        rst_fields(59)%vname="tilde_e3t_n";    rst_fields(59)%grid="grid_N" 
     329        rst_fields(60)%vname="hdiv_lf";        rst_fields(60)%grid="grid_N" 
     330        rst_fields(61)%vname="ub2_b";          rst_fields(61)%grid="grid_N" 
     331        rst_fields(62)%vname="vb2_b";          rst_fields(62)%grid="grid_N" 
     332        rst_fields(63)%vname="sshbb_e";        rst_fields(63)%grid="grid_N" 
     333        rst_fields(64)%vname="ubb_e";          rst_fields(64)%grid="grid_N" 
     334        rst_fields(65)%vname="vbb_e";          rst_fields(65)%grid="grid_N" 
     335        rst_fields(66)%vname="sshb_e";         rst_fields(66)%grid="grid_N" 
     336        rst_fields(67)%vname="ub_e";           rst_fields(67)%grid="grid_N" 
     337        rst_fields(68)%vname="vb_e";           rst_fields(68)%grid="grid_N" 
     338        rst_fields(69)%vname="fwf_isf_b";      rst_fields(69)%grid="grid_N" 
     339        rst_fields(70)%vname="isf_sc_b";       rst_fields(70)%grid="grid_N" 
     340        rst_fields(71)%vname="isf_hc_b";       rst_fields(71)%grid="grid_N" 
     341        rst_fields(72)%vname="ssh_ibb";        rst_fields(72)%grid="grid_N" 
     342        rst_fields(73)%vname="rnf_b";          rst_fields(73)%grid="grid_N" 
     343        rst_fields(74)%vname="rnf_hc_b";       rst_fields(74)%grid="grid_N" 
     344        rst_fields(75)%vname="rnf_sc_b";       rst_fields(75)%grid="grid_N" 
     345        rst_fields(76)%vname="nn_fsbc";        rst_fields(76)%grid="grid_scalar" 
     346        rst_fields(77)%vname="ssu_m";          rst_fields(77)%grid="grid_N" 
     347        rst_fields(78)%vname="ssv_m";          rst_fields(78)%grid="grid_N" 
     348        rst_fields(79)%vname="sst_m";          rst_fields(79)%grid="grid_N" 
     349        rst_fields(80)%vname="sss_m";          rst_fields(80)%grid="grid_N" 
     350        rst_fields(81)%vname="ssh_m";          rst_fields(81)%grid="grid_N" 
     351        rst_fields(82)%vname="e3t_m";          rst_fields(82)%grid="grid_N" 
     352        rst_fields(83)%vname="frq_m";          rst_fields(83)%grid="grid_N" 
     353        rst_fields(84)%vname="avmb";           rst_fields(84)%grid="Vgrid" 
     354        rst_fields(85)%vname="avtb";           rst_fields(85)%grid="Vgrid" 
    349355 
    350356   END SUBROUTINE set_rst_vars 
     
    353359   SUBROUTINE set_rstr_active() 
    354360!sets enabled = .TRUE. for each field in restart file 
    355         CHARACTER(len=256) :: rst_file 
    356         INTEGER :: i 
     361   CHARACTER(len=256) :: rst_file 
     362   TYPE(xios_field) :: field_hdl 
     363   TYPE(xios_file) :: file_hdl 
     364   TYPE(xios_filegroup) :: filegroup_hdl 
     365   INTEGER :: i 
    357366 
    358367        rst_file = TRIM(cn_ocerst_indir)//TRIM(cn_ocerst_in) 
    359368!set name of the restart file and enable available fields 
    360369        if(lwp) WRITE(numout,*) 'Setting restart filename (for XIOS) to: ',rst_file 
    361         CALL xios_set_file_attr( "rrestart", enabled = .TRUE.) 
    362         CALL xios_set_file_attr( "rrestart", name=trim(rst_file)) 
    363 !eneble fields in restart file  
     370        CALL xios_get_handle("file_definition", filegroup_hdl ) 
     371        CALL xios_add_child(filegroup_hdl, file_hdl, 'rrestart') 
     372        CALL xios_set_file_attr( "rrestart", name=trim(rst_file), type="one_file", & 
     373             par_access="collective", enabled=.TRUE., mode="read",                 & 
     374             output_freq=xios_timestep) 
     375!defin files for restart context 
    364376        DO i = 1, max_rst_fields 
    365          IF( TRIM(rst_fields(i)) /= "NO_NAME") THEN 
    366            IF( iom_varid( numror, TRIM(rst_fields(i)), ldstop = .FALSE. ) > 0 ) THEN 
    367              IF ( xios_is_valid_field( TRIM(rst_fields(i)) ) ) THEN 
    368                 CALL xios_set_field_attr ( TRIM(rst_fields(i)), enabled = .TRUE. )  
    369                 if(lwp) WRITE(numout,*) TRIM(rst_fields(i)), ' enabled' 
    370              ENDIF 
     377         IF( TRIM(rst_fields(i)%vname) /= "NO_NAME") THEN 
     378           IF( iom_varid( numror, TRIM(rst_fields(i)%vname), ldstop = .FALSE. ) > 0 ) THEN 
     379                CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     380                CALL xios_set_attr (field_hdl, enabled = .TRUE., name = TRIM(rst_fields(i)%vname), & 
     381                     grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
     382                if(lwp) WRITE(numout,*) TRIM(rst_fields(i)%vname), ' enabled' 
    371383           ENDIF 
    372384         ENDIF 
  • branches/UKMO/dev_r5518_GO6_package_XIOS_read/NEMOGCM/NEMO/OPA_SRC/IOM/iom_def.F90

    r8001 r8038  
    7474   END TYPE file_descriptor 
    7575   TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC ::   iom_file !: array containing the info for all opened files 
    76    INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 85  !maximum number of variables in a restart file 
    77    CHARACTER(len=30),DIMENSION(max_rst_fields), PUBLIC   :: rst_fields ! names of variables in restart file 
     76 
     77   INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 85   
     78!  CHARACTER(len=30),DIMENSION(max_rst_fields), PUBLIC   :: rst_fields ! names of variables in restart file 
     79 
     80   TYPE, PUBLIC :: RST_FIELD   
     81    CHARACTER(len=30) :: vname ! names of variables in restart file 
     82    CHARACTER(len=30) :: grid 
     83   END TYPE RST_FIELD 
     84   TYPE(RST_FIELD), PUBLIC :: rst_fields(max_rst_fields) 
    7885 
    7986!$AGRIF_END_DO_NOT_TREAT 
Note: See TracChangeset for help on using the changeset viewer.