New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8297 – NEMO

Changeset 8297


Ignore:
Timestamp:
2017-07-07T12:13:34+02:00 (7 years ago)
Author:
andmirek
Message:

#1882 New way of defining what is in restart file

Location:
branches/UKMO/dev_r7573_xios_write/NEMOGCM/NEMO/OPA_SRC/IOM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r7573_xios_write/NEMOGCM/NEMO/OPA_SRC/IOM/iom.F90

    r8227 r8297  
    4141   USE dianam          ! build name of file 
    4242   USE xios 
    43    USE iom_def, ONLY : max_rst_fields, rst_fields, wxioso 
     43   USE iom_def, ONLY : wxioso 
    4444# endif 
    4545   USE ioipsl, ONLY :  ju2ymds    ! for calendar 
     
    6868   PRIVATE iom_set_domain_attr, iom_set_axis_attr, iom_set_field_attr, iom_set_file_attr, iom_get_file_attr, iom_set_grid_attr 
    6969   PRIVATE set_grid, set_grid_bounds, set_scalar, set_xmlatt, set_mooring, iom_update_file_name, iom_sdate 
    70    PRIVATE set_rst_vars, set_rstw_active 
     70   PRIVATE set_rstw_active 
    7171# endif 
    7272 
     
    241241      ! automatic definitions of some of the xml attributs 
    242242      IF( TRIM(cdname) == TRIM(wxios_context)) THEN 
    243 !set names of the fields in restart file IF using XIOS to read/write data 
    244        CALL set_rst_vars() 
    245243!set which fields are to be read from restart file 
    246244       CALL set_rstw_active(filename, it) 
     
    263261 
    264262   END SUBROUTINE iom_init 
    265  
    266     
    267    SUBROUTINE set_rst_vars() 
    268 !set names for variables in restart file 
    269  
    270         rst_fields(:)%vname="NO_NAME";         rst_fields(:)%grid="NO_GRID" 
    271  
    272         rst_fields(1)%vname="rdt";             rst_fields(1)% grid="grid_scalar" 
    273         rst_fields(2)%vname="rdttra1";         rst_fields(2)% grid="grid_scalar"       
    274         rst_fields(3)%vname="un";              rst_fields(3)% grid="grid_N_3D" 
    275         rst_fields(4)%vname="ub";              rst_fields(4)% grid="grid_N_3D" 
    276         rst_fields(5)%vname="vn";              rst_fields(5)% grid="grid_N_3D" 
    277         rst_fields(6)%vname="vb";              rst_fields(6)% grid="grid_N_3D"   
    278         rst_fields(7)%vname="tn";              rst_fields(7)% grid="grid_N_3D" 
    279         rst_fields(8)%vname="tb";              rst_fields(8)% grid="grid_N_3D" 
    280         rst_fields(9)%vname="sn";              rst_fields(9)% grid="grid_N_3D" 
    281         rst_fields(10)%vname="sb";             rst_fields(10)%grid="grid_N_3D" 
    282         rst_fields(11)%vname="sshn";           rst_fields(11)%grid="grid_N" 
    283         rst_fields(12)%vname="sshb";           rst_fields(12)%grid="grid_N" 
    284         rst_fields(13)%vname="hdivn";          rst_fields(13)%grid="grid_N_3D" 
    285         rst_fields(14)%vname="hdivb";          rst_fields(14)%grid="grid_N_3D" 
    286         rst_fields(15)%vname="rhop";           rst_fields(15)%grid="grid_N_3D" 
    287         rst_fields(16)%vname="rotn";           rst_fields(16)%grid="grid_N_3D" 
    288         rst_fields(17)%vname="rotb";           rst_fields(17)%grid="grid_N_3D" 
    289         rst_fields(18)%vname="kt";             rst_fields(18)%grid="grid_scalar" 
    290         rst_fields(19)%vname="ndastp";         rst_fields(19)%grid="grid_scalar" 
    291         rst_fields(20)%vname="adatrj";         rst_fields(20)%grid="grid_scalar" 
    292         rst_fields(21)%vname="utau_b";         rst_fields(21)%grid="grid_N" 
    293         rst_fields(22)%vname="vtau_b";         rst_fields(22)%grid="grid_N" 
    294         rst_fields(23)%vname="qns_b";          rst_fields(23)%grid="grid_N" 
    295         rst_fields(24)%vname="emp_b";          rst_fields(24)%grid="grid_N" 
    296         rst_fields(25)%vname="sfx_b";          rst_fields(25)%grid="grid_N" 
    297         rst_fields(26)%vname="en" ;            rst_fields(26)%grid="grid_N_3D"  
    298         rst_fields(27)%vname="avt";            rst_fields(27)%grid="grid_N_3D" 
    299         rst_fields(28)%vname="avm";            rst_fields(28)%grid="grid_N_3D" 
    300         rst_fields(29)%vname="avmu";           rst_fields(29)%grid="grid_N_3D" 
    301         rst_fields(30)%vname="avmv";           rst_fields(30)%grid="grid_N_3D" 
    302         rst_fields(31)%vname="dissl";          rst_fields(31)%grid="grid_N_3D" 
    303         rst_fields(32)%vname="sbc_hc_b";       rst_fields(32)%grid="grid_N" 
    304         rst_fields(33)%vname="sbc_sc_b";       rst_fields(33)%grid="grid_N" 
    305         rst_fields(34)%vname="qsr_hc_b";       rst_fields(34)%grid="grid_N_3D" 
    306         rst_fields(35)%vname="gcx";            rst_fields(35)%grid="grid_N" 
    307         rst_fields(36)%vname="gcxb";           rst_fields(36)%grid="grid_N" 
    308         rst_fields(37)%vname="fraqsr_1lev";    rst_fields(37)%grid="grid_N" 
    309         rst_fields(38)%vname="greenland_icesheet_mass" 
    310                                                rst_fields(38)%grid="grid_scalar" 
    311         rst_fields(39)%vname="greenland_icesheet_timelapsed" 
    312                                                rst_fields(39)%grid="grid_scalar" 
    313         rst_fields(40)%vname="greenland_icesheet_mass_roc" 
    314                                                rst_fields(40)%grid="grid_scalar" 
    315         rst_fields(41)%vname="antarctica_icesheet_mass" 
    316                                                rst_fields(41)%grid="grid_scalar" 
    317         rst_fields(42)%vname="antarctica_icesheet_timelapsed" 
    318                                                rst_fields(42)%grid="grid_scalar" 
    319         rst_fields(43)%vname="antarctica_icesheet_mass_roc" 
    320                                                rst_fields(43)%grid="grid_scalar" 
    321         rst_fields(44)%vname="rhd";            rst_fields(44)%grid="grid_N_3D" 
    322         rst_fields(45)%vname="frc_v";          rst_fields(45)%grid="grid_scalar" 
    323         rst_fields(46)%vname="frc_t";          rst_fields(46)%grid="grid_scalar" 
    324         rst_fields(47)%vname="frc_s";          rst_fields(47)%grid="grid_scalar" 
    325         rst_fields(48)%vname="frc_wn_t";       rst_fields(48)%grid="grid_scalar" 
    326         rst_fields(49)%vname="frc_wn_s";       rst_fields(49)%grid="grid_scalar" 
    327         rst_fields(50)%vname="ssh_ini";        rst_fields(50)%grid="grid_N" 
    328         rst_fields(51)%vname="e3t_ini";        rst_fields(51)%grid="grid_N_3D" 
    329         rst_fields(52)%vname="hc_loc_ini";     rst_fields(52)%grid="grid_N_3D" 
    330         rst_fields(53)%vname="sc_loc_ini";     rst_fields(53)%grid="grid_N_3D" 
    331         rst_fields(54)%vname="ssh_hc_loc_ini"; rst_fields(54)%grid="grid_N" 
    332         rst_fields(55)%vname="ssh_sc_loc_ini"; rst_fields(55)%grid="grid_N" 
    333         rst_fields(56)%vname="fse3t_b";        rst_fields(56)%grid="grid_N_3D" 
    334         rst_fields(57)%vname="fse3t_n";        rst_fields(57)%grid="grid_N_3D" 
    335         rst_fields(58)%vname="tilde_e3t_b";    rst_fields(58)%grid="grid_N" 
    336         rst_fields(59)%vname="tilde_e3t_n";    rst_fields(59)%grid="grid_N" 
    337         rst_fields(60)%vname="hdiv_lf";        rst_fields(60)%grid="grid_N" 
    338         rst_fields(61)%vname="ub2_b";          rst_fields(61)%grid="grid_N" 
    339         rst_fields(62)%vname="vb2_b";          rst_fields(62)%grid="grid_N" 
    340         rst_fields(63)%vname="sshbb_e";        rst_fields(63)%grid="grid_N" 
    341         rst_fields(64)%vname="ubb_e";          rst_fields(64)%grid="grid_N" 
    342         rst_fields(65)%vname="vbb_e";          rst_fields(65)%grid="grid_N" 
    343         rst_fields(66)%vname="sshb_e";         rst_fields(66)%grid="grid_N" 
    344         rst_fields(67)%vname="ub_e";           rst_fields(67)%grid="grid_N" 
    345         rst_fields(68)%vname="vb_e";           rst_fields(68)%grid="grid_N" 
    346         rst_fields(69)%vname="fwf_isf_b";      rst_fields(69)%grid="grid_N" 
    347         rst_fields(70)%vname="isf_sc_b";       rst_fields(70)%grid="grid_N" 
    348         rst_fields(71)%vname="isf_hc_b";       rst_fields(71)%grid="grid_N" 
    349         rst_fields(72)%vname="ssh_ibb";        rst_fields(72)%grid="grid_N" 
    350         rst_fields(73)%vname="rnf_b";          rst_fields(73)%grid="grid_N" 
    351         rst_fields(74)%vname="rnf_hc_b";       rst_fields(74)%grid="grid_N" 
    352         rst_fields(75)%vname="rnf_sc_b";       rst_fields(75)%grid="grid_N" 
    353         rst_fields(76)%vname="nn_fsbc";        rst_fields(76)%grid="grid_scalar" 
    354         rst_fields(77)%vname="ssu_m";          rst_fields(77)%grid="grid_N" 
    355         rst_fields(78)%vname="ssv_m";          rst_fields(78)%grid="grid_N" 
    356         rst_fields(79)%vname="sst_m";          rst_fields(79)%grid="grid_N" 
    357         rst_fields(80)%vname="sss_m";          rst_fields(80)%grid="grid_N" 
    358         rst_fields(81)%vname="ssh_m";          rst_fields(81)%grid="grid_N" 
    359         rst_fields(82)%vname="e3t_m";          rst_fields(82)%grid="grid_N" 
    360         rst_fields(83)%vname="frq_m";          rst_fields(83)%grid="grid_N" 
    361         rst_fields(84)%vname="avmb";           rst_fields(84)%grid="Vgrid" 
    362         rst_fields(85)%vname="avtb";           rst_fields(85)%grid="Vgrid" 
    363  
    364    END SUBROUTINE set_rst_vars 
    365  
    366263 
    367264   SUBROUTINE set_rstw_active(rst_file, it) 
     
    372269   TYPE(xios_file) :: file_hdl 
    373270   TYPE(xios_filegroup) :: filegroup_hdl 
    374    INTEGER :: i 
    375271 
    376272!set then name of the restart file (OUTPUT!) and enable available fields 
     
    389285 
    390286        CALL xios_set_file_attr( "wrestart", name=trim(rst_file)) 
    391         call flush(numout)  
    392 !      CALL xios_update_calendar(it+1)       ! + one because we open restart file  
    393                                               ! 1 timestep before write 
    394  
    395 !define fields for restart write context 
    396 !in restart.F90 
    397         DO i= 1, 17 
    398            CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     287 
     288        CALL xios_add_child(file_hdl, field_hdl, "rdt") 
     289        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     290                  grid_ref = "grid_scalar", operation = "instant") 
     291 
     292        CALL xios_add_child(file_hdl, field_hdl, "rdttra1") 
     293        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     294                  grid_ref = "grid_scalar", operation = "instant") 
     295 
     296        CALL xios_add_child(file_hdl, field_hdl, "un") 
     297        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     298                  grid_ref = "grid_N_3D", operation = "instant") 
     299 
     300        CALL xios_add_child(file_hdl, field_hdl, "ub") 
     301        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     302                  grid_ref = "grid_N_3D", operation = "instant") 
     303 
     304        CALL xios_add_child(file_hdl, field_hdl, "vn") 
     305        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     306                  grid_ref = "grid_N_3D", operation = "instant") 
     307 
     308        CALL xios_add_child(file_hdl, field_hdl, "vb") 
     309        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     310                  grid_ref = "grid_N_3D", operation = "instant") 
     311 
     312        CALL xios_add_child(file_hdl, field_hdl, "tn") 
     313        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     314                  grid_ref = "grid_N_3D", operation = "instant") 
     315 
     316        CALL xios_add_child(file_hdl, field_hdl, "tb") 
     317        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     318                  grid_ref = "grid_N_3D", operation = "instant") 
     319 
     320        CALL xios_add_child(file_hdl, field_hdl, "sn") 
     321        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     322                  grid_ref = "grid_N_3D", operation = "instant") 
     323 
     324        CALL xios_add_child(file_hdl, field_hdl, "sb") 
     325        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     326                  grid_ref = "grid_N_3D", operation = "instant") 
     327 
     328        CALL xios_add_child(file_hdl, field_hdl, "sshn") 
     329        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     330                  grid_ref = "grid_N", operation = "instant") 
     331 
     332        CALL xios_add_child(file_hdl, field_hdl, "sshb") 
     333        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     334                  grid_ref = "grid_N", operation = "instant") 
     335 
     336        CALL xios_add_child(file_hdl, field_hdl, "hdivn") 
     337        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     338                  grid_ref = "grid_N_3D", operation = "instant") 
     339 
     340        CALL xios_add_child(file_hdl, field_hdl, "hdivb") 
     341        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     342                  grid_ref = "grid_N_3D", operation = "instant") 
     343 
     344        CALL xios_add_child(file_hdl, field_hdl, "rhop") 
     345        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     346                  grid_ref = "grid_N_3D", operation = "instant") 
     347 
     348        CALL xios_add_child(file_hdl, field_hdl, "rotn") 
     349        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     350                  grid_ref = "grid_N_3D", operation = "instant") 
     351 
     352        CALL xios_add_child(file_hdl, field_hdl, "rotb") 
     353        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     354                  grid_ref = "grid_N_3D", operation = "instant") 
     355 
     356 
     357!in daymod.F90 
     358           CALL xios_add_child(file_hdl, field_hdl, "kt") 
    399359           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    400                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    401            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    402         ENDDO 
    403 !in daymod.F90 
    404         DO i= 18, 20 
    405                       CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     360                     grid_ref = "grid_scalar", operation = "instant") 
     361 
     362           CALL xios_add_child(file_hdl, field_hdl, "ndastp") 
    406363           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    407                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    408            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    409         ENDDO 
     364                     grid_ref = "grid_scalar", operation = "instant") 
     365 
     366           CALL xios_add_child(file_hdl, field_hdl, "adatrj") 
     367           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     368                     grid_ref = "grid_scalar", operation = "instant") 
    410369!end daymod.F90 
    411370!sbcmod.F90 
    412         DO i= 21, 25 
    413            CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     371           CALL xios_add_child(file_hdl, field_hdl, "utau_b") 
    414372           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    415                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    416            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    417         ENDDO 
     373                     grid_ref = "grid_N", operation = "instant") 
     374 
     375           CALL xios_add_child(file_hdl, field_hdl, "vtau_b") 
     376           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     377                     grid_ref = "grid_N", operation = "instant") 
     378 
     379           CALL xios_add_child(file_hdl, field_hdl, "qns_b") 
     380           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     381                     grid_ref = "grid_N", operation = "instant") 
     382 
     383           CALL xios_add_child(file_hdl, field_hdl, "emp_b") 
     384           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     385                     grid_ref = "grid_N", operation = "instant") 
     386 
     387           CALL xios_add_child(file_hdl, field_hdl, "sfx_b") 
     388           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     389                     grid_ref = "grid_N", operation = "instant") 
    418390!end sbcmod.F90 
    419391!ALL FIELDS ABOUVE ALWAYS 
    420392!zdftke.F90 
    421393#if defined key_zdftke   ||   defined key_esopa 
    422         DO i= 26, 31 
    423            CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     394           CALL xios_add_child(file_hdl, field_hdl, "en") 
    424395           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    425                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    426            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    427         ENDDO 
     396                     grid_ref = "grid_N_3D", operation = "instant") 
     397 
     398           CALL xios_add_child(file_hdl, field_hdl, "avt") 
     399           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     400                     grid_ref = "grid_N_3D", operation = "instant") 
     401 
     402           CALL xios_add_child(file_hdl, field_hdl, "avm") 
     403           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     404                     grid_ref = "grid_N_3D", operation = "instant") 
     405 
     406           CALL xios_add_child(file_hdl, field_hdl, "avmu") 
     407           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     408                     grid_ref = "grid_N_3D", operation = "instant") 
     409 
     410           CALL xios_add_child(file_hdl, field_hdl, "avmv") 
     411           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     412                     grid_ref = "grid_N_3D", operation = "instant") 
     413 
     414           CALL xios_add_child(file_hdl, field_hdl, "dissl") 
     415           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     416                     grid_ref = "grid_N_3D", operation = "instant") 
    428417#endif 
    429418!end zdftke.F90 
    430419!traqsr.F90 
    431        i = 34 
    432        CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     420       CALL xios_add_child(file_hdl, field_hdl, "qsr_hc_b") 
    433421       CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    434                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant")         
    435        if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    436        i = 37 
    437        CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     422                     grid_ref = "grid_N_3D" , operation = "instant")         
     423 
     424       CALL xios_add_child(file_hdl, field_hdl, "fraqsr_1lev") 
    438425       CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    439                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant")         
    440        if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
     426                     grid_ref = "grid_N", operation = "instant")         
    441427!END traqsr.F90 
    442428#if defined key_dynspg_flt   ||   defined key_esopa  
    443429!dynspg_flt.F90 
    444         DO i= 35, 36 
    445            CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     430           CALL xios_add_child(file_hdl, field_hdl, "gcx") 
    446431           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    447                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    448            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    449         ENDDO 
     432                     grid_ref = "grid_N", operation = "instant") 
     433 
     434           CALL xios_add_child(file_hdl, field_hdl, "gcxb") 
     435           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     436                     grid_ref = "grid_N", operation = "instant") 
    450437!end dynspg_flt.F90 
    451438#endif 
    452439!trasbc.F90 START 
    453         DO i= 32, 33 
    454            CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     440           CALL xios_add_child(file_hdl, field_hdl, "sbc_hc_b") 
    455441           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    456                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    457            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    458         ENDDO 
    459         DO i= 69, 71 
    460            CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     442                     grid_ref = "grid_N", operation = "instant") 
     443 
     444           CALL xios_add_child(file_hdl, field_hdl, "sbc_sc_b") 
    461445           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    462                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    463            if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    464         ENDDO 
     446                     grid_ref = "grid_N", operation = "instant") 
     447 
     448           CALL xios_add_child(file_hdl, field_hdl, "fwf_isf_b") 
     449           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     450                     grid_ref = "grid_N", operation = "instant") 
     451 
     452           CALL xios_add_child(file_hdl, field_hdl, "isf_sc_b") 
     453           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     454                     grid_ref = "grid_N", operation = "instant") 
     455 
     456           CALL xios_add_child(file_hdl, field_hdl, "isf_hc_b") 
     457           CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     458                     grid_ref = "grid_N", operation = "instant") 
    465459!trasbc.F90 END 
    466460        IF( lk_oasis) THEN 
    467461        ! ln_coupled_iceshelf_fluxes uninitialised unless lk_oasis=true 
    468462          IF( ln_coupled_iceshelf_fluxes ) THEN 
    469              DO i= 38, 43 
    470                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    471                 CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    472                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    473                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    474              ENDDO 
     463             CALL xios_add_child(file_hdl, field_hdl, "greenland_icesheet_mass") 
     464             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     465                  grid_ref = "grid_scalar", operation = "instant") 
     466 
     467             CALL xios_add_child(file_hdl, field_hdl, "greenland_icesheet_timelapsed") 
     468             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     469                  grid_ref = "grid_scalar", operation = "instant") 
     470 
     471             CALL xios_add_child(file_hdl, field_hdl, "greenland_icesheet_mass_roc") 
     472             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     473                  grid_ref = "grid_scalar", operation = "instant") 
     474 
     475             CALL xios_add_child(file_hdl, field_hdl, "antarctica_icesheet_mass") 
     476             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     477                  grid_ref = "grid_scalar", operation = "instant") 
     478 
     479             CALL xios_add_child(file_hdl, field_hdl, "antarctica_icesheet_timelapsed") 
     480             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     481                  grid_ref = "grid_scalar", operation = "instant") 
     482 
     483             CALL xios_add_child(file_hdl, field_hdl, "antarctica_icesheet_mass_roc") 
     484             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     485                  grid_ref = "grid_scalar", operation = "instant") 
    475486          ENDIF 
    476487        ENDIF 
    477488#if defined key_zdfkpp 
    478         i = 44 
    479         CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     489        CALL xios_add_child(file_hdl, field_hdl, "rhd") 
    480490        CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    481              grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    482         if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
     491             grid_ref = "grid_N_3D", operation = "instant") 
    483492#endif 
    484493!dia_hsb_rst 
    485494#if defined key_diadct 
    486495        IF( lk_diadct     ) THEN 
    487              DO i= 45, 47 
    488                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     496             CALL xios_add_child(file_hdl, field_hdl, "frc_v") 
     497             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     498                  grid_ref = "grid_scalar", operation = "instant") 
     499 
     500             CALL xios_add_child(file_hdl, field_hdl, "frc_t") 
     501             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     502                  grid_ref = "grid_scalar", operation = "instant") 
     503 
     504             CALL xios_add_child(file_hdl, field_hdl, "frc_s") 
     505             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     506                  grid_ref = "grid_scalar", operation = "instant") 
     507 
     508             CALL xios_add_child(file_hdl, field_hdl, "ssh_ini") 
     509             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     510                  grid_ref = "grid_N", operation = "instant") 
     511 
     512             CALL xios_add_child(file_hdl, field_hdl, "e3t_ini") 
     513             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     514                  grid_ref = "grid_N_3D", operation = "instant") 
     515 
     516             CALL xios_add_child(file_hdl, field_hdl, "hc_loc_ini") 
     517             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     518                  grid_ref = "grid_N_3D", operation = "instant") 
     519 
     520             CALL xios_add_child(file_hdl, field_hdl, "sc_loc_ini") 
     521             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     522                  grid_ref = "grid_N_3D", operation = "instant") 
     523 
     524 
     525             IF( .NOT. lk_vvl ) THEN 
     526                CALL xios_add_child(file_hdl, field_hdl, "frc_wn_t") 
    489527                CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    490                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    491                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    492              ENDDO 
    493  
    494              DO i= 50, 53 
    495                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     528                     grid_ref = "grid_scalar", operation = "instant") 
     529 
     530                CALL xios_add_child(file_hdl, field_hdl, "frc_wn_s") 
    496531                CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    497                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    498                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    499              ENDDO 
    500              IF( .NOT. lk_vvl ) THEN 
    501              DO i= 48, 48 
    502                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     532                     grid_ref = "grid_scalar", operation = "instant") 
     533 
     534                CALL xios_add_child(file_hdl, field_hdl, "ssh_hc_loc_ini") 
    503535                CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    504                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    505                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    506              ENDDO 
    507              DO i= 54, 55 
    508                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     536                     grid_ref = "grid_N", operation = "instant") 
     537 
     538                CALL xios_add_child(file_hdl, field_hdl, "ssh_sc_loc_ini") 
    509539                CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    510                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    511                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    512              ENDDO 
     540                     grid_ref = "grid_N", operation = "instant") 
     541 
     542 
    513543             ENDIF 
    514544        ENDIF 
     
    517547!domvvl.F90 
    518548        IF( lk_vvl ) THEN 
    519              DO i= 56, 57 
    520                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    521                 CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    522                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    523                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    524              ENDDO 
     549             CALL xios_add_child(file_hdl, field_hdl, "fse3t_b") 
     550             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     551                  grid_ref = "grid_N_3D", operation = "instant") 
     552 
     553             CALL xios_add_child(file_hdl, field_hdl, "fse3t_n") 
     554             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     555                  grid_ref = "grid_N_3D", operation = "instant") 
     556 
    525557           IF( lr_vvl_ztilde .OR. lr_vvl_layer ) THEN  ! z_tilde and layer cases ! 
    526              DO i= 58, 59 
    527                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    528                 CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    529                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    530                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    531              ENDDO 
     558             CALL xios_add_child(file_hdl, field_hdl, "tilde_e3t_b") 
     559             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     560                  grid_ref = "grid_N", operation = "instant") 
     561 
     562             CALL xios_add_child(file_hdl, field_hdl, "tilde_e3t_n") 
     563             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     564                  grid_ref = "grid_N", operation = "instant") 
    532565            END IF 
    533566            IF( lr_vvl_ztilde ) THEN                    ! z_tilde case ! 
    534             i=60 
    535             CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     567            CALL xios_add_child(file_hdl, field_hdl, "hdiv_lf") 
    536568            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    537                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    538             if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
     569                     grid_ref = "grid_N", operation = "instant") 
    539570            ENDIF 
    540571         ENDIF 
     
    542573!dynspg_ts.F90 
    543574#if defined key_dynspg_ts   ||   defined key_esopa 
    544          DO i= 61, 62 
    545             CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     575         CALL xios_add_child(file_hdl, field_hdl, "ub2_b") 
     576         CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     577              grid_ref = "grid_N", operation = "instant") 
     578 
     579         CALL xios_add_child(file_hdl, field_hdl, "vb2_b") 
     580         CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     581              grid_ref = "grid_N", operation = "instant") 
     582 
     583 
     584         IF (.NOT.ln_bt_av) THEN 
     585            CALL xios_add_child(file_hdl, field_hdl, "sshbb_e") 
    546586            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    547                  grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    548             if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    549          ENDDO 
    550          IF (.NOT.ln_bt_av) THEN 
    551             DO i= 63, 68 
    552                CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    553                CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    554                     grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    555                if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    556             ENDDO 
     587                 grid_ref = "grid_N", operation = "instant") 
     588 
     589            CALL xios_add_child(file_hdl, field_hdl, "ubb_e") 
     590            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     591                 grid_ref = "grid_N", operation = "instant") 
     592 
     593            CALL xios_add_child(file_hdl, field_hdl, "vbb_e") 
     594            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     595                 grid_ref = "grid_N", operation = "instant") 
     596 
     597            CALL xios_add_child(file_hdl, field_hdl, "sshb_e") 
     598            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     599                 grid_ref = "grid_N", operation = "instant") 
     600 
     601            CALL xios_add_child(file_hdl, field_hdl, "ub_e") 
     602            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     603                 grid_ref = "grid_N", operation = "instant") 
     604 
     605            CALL xios_add_child(file_hdl, field_hdl, "vb_e") 
     606            CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     607                 grid_ref = "grid_N", operation = "instant") 
    557608         ENDIF 
    558609#if defined key_agrif 
    559610         ! Save time integrated fluxes 
    560611         IF ( .NOT.Agrif_Root() ) THEN 
    561             DO i= 84, 85 
    562                CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     612               CALL xios_add_child(file_hdl, field_hdl, "ub2_i_b") 
    563613               CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    564                     grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    565                if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    566             ENDDO 
     614                    grid_ref = "GRID_N", operation = "instant") 
     615 
     616               CALL xios_add_child(file_hdl, field_hdl, "vb2_i_b") 
     617               CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     618                    grid_ref = "grid_N", operation = "instant") 
    567619         ENDIF 
    568620#endif 
     
    571623!sbcapr.F90 
    572624          IF( ln_apr_dyn) THEN 
    573              i = 72 
    574              CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    575              CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    576                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    577              if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
     625             CALL xios_add_child(file_hdl, field_hdl, "ssh_ibb") 
     626             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     627                     grid_ref = "grid_N", operation = "instant") 
    578628          ENDIF 
    579629!end sbcapr.F90 
    580630!sbcrnf.F90 
    581631        IF( ln_rnf      ) THEN 
    582              DO i= 73, 75 
    583                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    584                 CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    585                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    586                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    587              ENDDO 
     632             CALL xios_add_child(file_hdl, field_hdl, "rnf_b") 
     633             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     634                  grid_ref = "grid_N", operation = "instant") 
     635 
     636             CALL xios_add_child(file_hdl, field_hdl, "rnf_hc_b") 
     637             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     638                  grid_ref = "grid_N", operation = "instant") 
     639 
     640             CALL xios_add_child(file_hdl, field_hdl, "rnf_sc_b") 
     641             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     642                  grid_ref = "grid_N", operation = "instant") 
    588643        ENDIF  
    589644!end sbcrnf.F90 
    590645!sbcssm.F90 
    591646        IF( nn_components /= jp_iam_sas .AND. nn_fsbc .NE. 1) THEN 
    592              DO i= 76, 81 
    593                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
     647             CALL xios_add_child(file_hdl, field_hdl, "nn_fsbc") 
     648             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     649                  grid_ref = "grid_scalar", operation = "instant") 
     650 
     651             CALL xios_add_child(file_hdl, field_hdl, "ssu_m") 
     652             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     653                  grid_ref = "grid_N", operation = "instant") 
     654 
     655             CALL xios_add_child(file_hdl, field_hdl, "ssv_m") 
     656             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     657                  grid_ref = "grid_N", operation = "instant") 
     658 
     659             CALL xios_add_child(file_hdl, field_hdl, "sst_m") 
     660             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     661                  grid_ref = "grid_N", operation = "instant") 
     662 
     663             CALL xios_add_child(file_hdl, field_hdl, "sss_m") 
     664             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     665                  grid_ref = "grid_N", operation = "instant") 
     666 
     667             CALL xios_add_child(file_hdl, field_hdl, "ssh_m") 
     668             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     669                  grid_ref = "grid_N", operation = "instant") 
     670 
     671             CALL xios_add_child(file_hdl, field_hdl, "frq_m") 
     672             CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     673                     grid_ref = "grid_N", operation = "instant") 
     674 
     675             IF( lk_vvl )  THEN 
     676                CALL xios_add_child(file_hdl, field_hdl, "e3t_m") 
    594677                CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    595                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    596                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    597              ENDDO 
    598              i = 83 
    599              CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    600              CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    601                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    602              if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    603              IF( lk_vvl )  THEN 
    604                 i = 82 
    605                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    606                 CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    607                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    608                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
     678                     grid_ref = "grid_N", operation = "instant") 
    609679             ENDIF  
    610680        ENDIF 
    611681!end sbcssm.F90 
    612682       IF( lr_traadv_cen2   ) THEN 
    613             DO i= 84, 85 
    614                 CALL xios_add_child(file_hdl, field_hdl, TRIM(rst_fields(i)%vname)) 
    615                 CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
    616                      grid_ref = TRIM(rst_fields(i)%grid ), operation = "instant") 
    617                 if(lwp) write(numout,*) 'id= ',i,' set ', TRIM(rst_fields(i)%vname), ' enabled' 
    618              ENDDO 
     683          CALL xios_add_child(file_hdl, field_hdl, "avmb") 
     684          CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     685               grid_ref = "Vgrid", operation = "instant") 
     686 
     687          CALL xios_add_child(file_hdl, field_hdl, "avtb") 
     688          CALL xios_set_attr (field_hdl, enabled = .TRUE., prec = 8,           & 
     689               grid_ref = "Vgrid", operation = "instant") 
    619690       ENDIF 
    620691 
  • branches/UKMO/dev_r7573_xios_write/NEMOGCM/NEMO/OPA_SRC/IOM/iom_def.F90

    r8079 r8297  
    7575   END TYPE file_descriptor 
    7676   TYPE(file_descriptor), DIMENSION(jpmax_files), PUBLIC ::   iom_file !: array containing the info for all opened files 
    77  
    78    INTEGER, PARAMETER, PUBLIC                   :: max_rst_fields = 85   
    79  
    80  
    81    TYPE, PUBLIC :: RST_FIELD   
    82     CHARACTER(len=30) :: vname ! names of variables in restart file 
    83     CHARACTER(len=30) :: grid 
    84    END TYPE RST_FIELD 
    85    TYPE(RST_FIELD), PUBLIC :: rst_fields(max_rst_fields) 
    86    !  values needed to set correctlyfiles in reast file when using XIOS for writing 
    8777!$AGRIF_END_DO_NOT_TREAT 
    8878   !!===================================================================== 
Note: See TracChangeset for help on using the changeset viewer.