Ignore:
Timestamp:
Jul 24, 2024, 4:39:59 PM (4 months ago)
Author:
abarral
Message:

Replace iniprint.h by lmdz_iniprint.f90
(lint) along the way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90

    r5117 r5118  
    1 SUBROUTINE dynredem0_loc(fichnom,iday_end,phis)
    2 
    3 !-------------------------------------------------------------------------------
    4 ! Write the NetCDF restart file (initialization).
    5 !-------------------------------------------------------------------------------
     1SUBROUTINE dynredem0_loc(fichnom, iday_end, phis)
     2
     3  !-------------------------------------------------------------------------------
     4  ! Write the NetCDF restart file (initialization).
     5  !-------------------------------------------------------------------------------
    66  USE IOIPSL
    77  USE parallel_lmdz
     
    99  USE lmdz_strings, ONLY: maxlen
    1010  USE infotrac, ONLY: nqtot, tracers
    11   USE netcdf, ONLY: nf90_create, nf90_def_dim, nf90_inq_varid, nf90_global,    &
    12                     nf90_close,  nf90_put_att, nf90_unlimited, nf90_clobber,  &
    13                     nf90_64bit_offset
     11  USE netcdf, ONLY: nf90_create, nf90_def_dim, nf90_inq_varid, nf90_global, &
     12          nf90_close, nf90_put_att, nf90_unlimited, nf90_clobber, &
     13          nf90_64bit_offset
    1414  USE dynredem_mod, ONLY: cre_var, put_var, err, modname, fil
    15   USE comvert_mod,  ONLY: ap, bp, presnivs, pa, preff, nivsig, nivsigs,&
    16                           aps,bps,pseudoalt
     15  USE comvert_mod, ONLY: ap, bp, presnivs, pa, preff, nivsig, nivsigs, &
     16          aps, bps, pseudoalt
    1717  USE comconst_mod, ONLY: cpp, daysec, dtvr, g, kappa, omeg, rad
    1818  USE logic_mod, ONLY: fxyhypb, ysinus
    19   USE serre_mod, ONLY: clon,clat,grossismx,grossismy,dzoomx,dzoomy, &
    20                        taux,tauy
     19  USE serre_mod, ONLY: clon, clat, grossismx, grossismy, dzoomx, dzoomy, &
     20          taux, tauy
    2121  USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn, itaufin, start_time
    22   USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
     22  USE ener_mod, ONLY: etot0, ptot0, ztot0, stot0, ang0
    2323  USE lmdz_description, ONLY: descript
     24  USE lmdz_iniprint, ONLY: lunout, prt_level
    2425
    2526  IMPLICIT NONE
     
    2728  include "paramet.h"
    2829  include "comgeom.h"
    29   include "iniprint.h"
    30 !===============================================================================
    31 ! Arguments:
    32   CHARACTER(LEN=*), INTENT(IN) :: fichnom          !--- FILE NAME
    33   INTEGER,          INTENT(IN) :: iday_end         !---
    34   REAL,             INTENT(IN) :: phis(ijb_u:ije_u)!--- GROUND GEOPOTENTIAL
    35 !===============================================================================
    36 ! Local variables:
     30  !===============================================================================
     31  ! Arguments:
     32  CHARACTER(LEN = *), INTENT(IN) :: fichnom          !--- FILE NAME
     33  INTEGER, INTENT(IN) :: iday_end         !---
     34  REAL, INTENT(IN) :: phis(ijb_u:ije_u)!--- GROUND GEOPOTENTIAL
     35  !===============================================================================
     36  ! Local variables:
    3737  INTEGER :: iq
    38   INTEGER, PARAMETER :: length=100
    39   REAL    :: tab_cntrl(length)                     !--- RUN PARAMETERS TABLE
    40   REAL    :: phis_glo(ip1jmp1)
    41 !   For NetCDF:
    42   CHARACTER(LEN=maxlen) :: unites
     38  INTEGER, PARAMETER :: length = 100
     39  REAL :: tab_cntrl(length)                     !--- RUN PARAMETERS TABLE
     40  REAL :: phis_glo(ip1jmp1)
     41  !   For NetCDF:
     42  CHARACTER(LEN = maxlen) :: unites
    4343  INTEGER :: indexID
    4444  INTEGER :: rlonuID, rlonvID, rlatuID, rlatvID
    4545  INTEGER :: sID, sigID, nID, timID
    4646  INTEGER :: yyears0, jjour0, mmois0
    47   REAL    :: zjulian, hours
    48 !===============================================================================
    49   modname='dynredem0'; fil=fichnom
    50   CALL Gather_field_u(phis,phis_glo,1)
     47  REAL :: zjulian, hours
     48  !===============================================================================
     49  modname = 'dynredem0'; fil = fichnom
     50  CALL Gather_field_u(phis, phis_glo, 1)
    5151  IF(mpi_rank/=0) RETURN
    5252
     
    5454  CALL ju2ymds(zjulian, yyears0, mmois0, jjour0, hours)
    5555
    56   tab_cntrl(:)  = 0.
    57   tab_cntrl(1)  = REAL(iim)
    58   tab_cntrl(2)  = REAL(jjm)
    59   tab_cntrl(3)  = REAL(llm)
    60   tab_cntrl(4)  = REAL(day_ref)
    61   tab_cntrl(5)  = REAL(annee_ref)
    62   tab_cntrl(6)  = rad
    63   tab_cntrl(7)  = omeg
    64   tab_cntrl(8)  = g
    65   tab_cntrl(9)  = cpp
     56  tab_cntrl(:) = 0.
     57  tab_cntrl(1) = REAL(iim)
     58  tab_cntrl(2) = REAL(jjm)
     59  tab_cntrl(3) = REAL(llm)
     60  tab_cntrl(4) = REAL(day_ref)
     61  tab_cntrl(5) = REAL(annee_ref)
     62  tab_cntrl(6) = rad
     63  tab_cntrl(7) = omeg
     64  tab_cntrl(8) = g
     65  tab_cntrl(9) = cpp
    6666  tab_cntrl(10) = kappa
    6767  tab_cntrl(11) = daysec
     
    7575  tab_cntrl(19) = preff
    7676
    77 !    .....    parameters for zoom    ......   
     77  !    .....    parameters for zoom    ......
    7878  tab_cntrl(20) = clon
    7979  tab_cntrl(21) = clat
     
    8181  tab_cntrl(23) = grossismy
    8282
    83   IF ( fxyhypb )   THEN
     83  IF (fxyhypb)   THEN
    8484    tab_cntrl(24) = 1.
    8585    tab_cntrl(25) = dzoomx
     
    9595    tab_cntrl(28) = 0.
    9696    tab_cntrl(29) = 0.
    97     IF( ysinus )  tab_cntrl(27) = 1.
     97    IF(ysinus)  tab_cntrl(27) = 1.
    9898  END IF
    9999  tab_cntrl(30) = REAL(iday_end)
    100100  tab_cntrl(31) = REAL(itau_dyn + itaufin)
    101 ! start_time: start_time of simulation (not necessarily 0.)
     101  ! start_time: start_time of simulation (not necessarily 0.)
    102102  tab_cntrl(32) = start_time
    103103
    104 !--- File creation
    105   CALL err(nf90_create(fichnom,IOR(nf90_clobber,nf90_64bit_offset),nid))
    106 
    107 !--- Some global attributes
    108   CALL err(nf90_put_att(nid,nf90_global,"title","Fichier demarrage dynamique"))
    109 
    110 !--- Dimensions
    111   CALL err(nf90_def_dim(nid,"index", length, indexID))
    112   CALL err(nf90_def_dim(nid,"rlonu", iip1,  rlonuID))
    113   CALL err(nf90_def_dim(nid,"rlatu", jjp1,  rlatuID))
    114   CALL err(nf90_def_dim(nid,"rlonv", iip1,  rlonvID))
    115   CALL err(nf90_def_dim(nid,"rlatv", jjm,    rlatvID))
    116   CALL err(nf90_def_dim(nid,"sigs",  llm,        sID))
    117   CALL err(nf90_def_dim(nid,"sig",   llmp1,    sigID))
    118   CALL err(nf90_def_dim(nid,"temps", nf90_unlimited, timID))
    119 
    120 !--- Define and save invariant fields
    121   CALL put_var(nid,"controle","Parametres de controle" ,[indexID],tab_cntrl)
    122   CALL put_var(nid,"rlonu"   ,"Longitudes des points U",[rlonuID],rlonu)
    123   CALL put_var(nid,"rlatu"   ,"Latitudes des points U" ,[rlatuID],rlatu)
    124   CALL put_var(nid,"rlonv"   ,"Longitudes des points V",[rlonvID],rlonv)
    125   CALL put_var(nid,"rlatv"   ,"Latitudes des points V" ,[rlatvID],rlatv)
    126   CALL put_var(nid,"nivsigs" ,"Numero naturel des couches s"    ,[sID]  ,nivsigs)
    127   CALL put_var(nid,"nivsig"  ,"Numero naturel des couches sigma",[sigID],nivsig)
    128   CALL put_var(nid,"ap"      ,"Coefficient A pour hybride"      ,[sigID],ap)
    129   CALL put_var(nid,"bp"      ,"Coefficient B pour hybride"      ,[sigID],bp)
    130   CALL put_var(nid,"presnivs",""                                ,[sID]  ,presnivs)
    131 ! covariant <-> contravariant <-> natural conversion coefficients
    132   CALL put_var(nid,"cu","Coefficient de passage pour U",[rlonuID,rlatuID],cu)
    133   CALL put_var(nid,"cv","Coefficient de passage pour V",[rlonvID,rlatvID],cv)
    134   CALL put_var(nid,"aire","Aires de chaque maille"     ,[rlonvID,rlatuID],aire)
    135   CALL put_var(nid,"phisinit","Geopotentiel au sol"    ,[rlonvID,rlatuID],phis_glo)
    136 
    137 !--- Define fields saved later
    138   WRITE(unites,"('days since ',i4,'-',i2.2,'-',i2.2,' 00:00:00')") &
    139                yyears0,mmois0,jjour0
    140   CALL cre_var(nid,"temps","Temps de simulation",[timID],unites)
    141   CALL cre_var(nid,"ucov" ,"Vitesse U"  ,[rlonuID,rlatuID,sID,timID])
    142   CALL cre_var(nid,"vcov" ,"Vitesse V"  ,[rlonvID,rlatvID,sID,timID])
    143   CALL cre_var(nid,"teta" ,"Temperature",[rlonvID,rlatuID,sID,timID])
    144   DO iq=1,nqtot
    145     CALL cre_var(nid,tracers(iq)%name,tracers(iq)%longName,[rlonvID,rlatuID,sID,timID])
     104  !--- File creation
     105  CALL err(nf90_create(fichnom, IOR(nf90_clobber, nf90_64bit_offset), nid))
     106
     107  !--- Some global attributes
     108  CALL err(nf90_put_att(nid, nf90_global, "title", "Fichier demarrage dynamique"))
     109
     110  !--- Dimensions
     111  CALL err(nf90_def_dim(nid, "index", length, indexID))
     112  CALL err(nf90_def_dim(nid, "rlonu", iip1, rlonuID))
     113  CALL err(nf90_def_dim(nid, "rlatu", jjp1, rlatuID))
     114  CALL err(nf90_def_dim(nid, "rlonv", iip1, rlonvID))
     115  CALL err(nf90_def_dim(nid, "rlatv", jjm, rlatvID))
     116  CALL err(nf90_def_dim(nid, "sigs", llm, sID))
     117  CALL err(nf90_def_dim(nid, "sig", llmp1, sigID))
     118  CALL err(nf90_def_dim(nid, "temps", nf90_unlimited, timID))
     119
     120  !--- Define and save invariant fields
     121  CALL put_var(nid, "controle", "Parametres de controle", [indexID], tab_cntrl)
     122  CALL put_var(nid, "rlonu", "Longitudes des points U", [rlonuID], rlonu)
     123  CALL put_var(nid, "rlatu", "Latitudes des points U", [rlatuID], rlatu)
     124  CALL put_var(nid, "rlonv", "Longitudes des points V", [rlonvID], rlonv)
     125  CALL put_var(nid, "rlatv", "Latitudes des points V", [rlatvID], rlatv)
     126  CALL put_var(nid, "nivsigs", "Numero naturel des couches s", [sID], nivsigs)
     127  CALL put_var(nid, "nivsig", "Numero naturel des couches sigma", [sigID], nivsig)
     128  CALL put_var(nid, "ap", "Coefficient A pour hybride", [sigID], ap)
     129  CALL put_var(nid, "bp", "Coefficient B pour hybride", [sigID], bp)
     130  CALL put_var(nid, "presnivs", "", [sID], presnivs)
     131  ! covariant <-> contravariant <-> natural conversion coefficients
     132  CALL put_var(nid, "cu", "Coefficient de passage pour U", [rlonuID, rlatuID], cu)
     133  CALL put_var(nid, "cv", "Coefficient de passage pour V", [rlonvID, rlatvID], cv)
     134  CALL put_var(nid, "aire", "Aires de chaque maille", [rlonvID, rlatuID], aire)
     135  CALL put_var(nid, "phisinit", "Geopotentiel au sol", [rlonvID, rlatuID], phis_glo)
     136
     137  !--- Define fields saved later
     138  WRITE(unites, "('days since ',i4,'-',i2.2,'-',i2.2,' 00:00:00')") &
     139          yyears0, mmois0, jjour0
     140  CALL cre_var(nid, "temps", "Temps de simulation", [timID], unites)
     141  CALL cre_var(nid, "ucov", "Vitesse U", [rlonuID, rlatuID, sID, timID])
     142  CALL cre_var(nid, "vcov", "Vitesse V", [rlonvID, rlatvID, sID, timID])
     143  CALL cre_var(nid, "teta", "Temperature", [rlonvID, rlatuID, sID, timID])
     144  DO iq = 1, nqtot
     145    CALL cre_var(nid, tracers(iq)%name, tracers(iq)%longName, [rlonvID, rlatuID, sID, timID])
    146146  END DO
    147   CALL cre_var(nid,"masse","Masse d air"    ,[rlonvID,rlatuID,sID,timID])
    148   CALL cre_var(nid,"ps"   ,"Pression au sol",[rlonvID,rlatuID    ,timID])
     147  CALL cre_var(nid, "masse", "Masse d air", [rlonvID, rlatuID, sID, timID])
     148  CALL cre_var(nid, "ps", "Pression au sol", [rlonvID, rlatuID, timID])
    149149  CALL err(nf90_close (nid))
    150150
    151   WRITE(lunout,*)TRIM(modname)//': iim,jjm,llm,iday_end',iim,jjm,llm,iday_end
    152   WRITE(lunout,*)TRIM(modname)//': rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa
     151  WRITE(lunout, *)TRIM(modname) // ': iim,jjm,llm,iday_end', iim, jjm, llm, iday_end
     152  WRITE(lunout, *)TRIM(modname) // ': rad,omeg,g,cpp,kappa', rad, omeg, g, cpp, kappa
    153153
    154154END SUBROUTINE dynredem0_loc
     
    159159!-------------------------------------------------------------------------------
    160160
    161 SUBROUTINE dynredem1_loc(fichnom,time,vcov,ucov,teta,q,masse,ps)
    162 
    163 !-------------------------------------------------------------------------------
    164 ! Purpose: Write the NetCDF restart file (append).
    165 !-------------------------------------------------------------------------------
     161SUBROUTINE dynredem1_loc(fichnom, time, vcov, ucov, teta, q, masse, ps)
     162
     163  !-------------------------------------------------------------------------------
     164  ! Purpose: Write the NetCDF restart file (append).
     165  !-------------------------------------------------------------------------------
    166166  USE parallel_lmdz
    167167  USE mod_hallo
     
    169169  USE infotrac, ONLY: nqtot, tracers, type_trac
    170170  USE control_mod
    171   USE netcdf,   ONLY: nf90_open,  nf90_nowrite, nf90_get_var, nf90_inq_varid, &
    172                       nf90_close, nf90_write,  nf90_put_var, nf90_noerr
     171  USE netcdf, ONLY: nf90_open, nf90_nowrite, nf90_get_var, nf90_inq_varid, &
     172          nf90_close, nf90_write, nf90_put_var, nf90_noerr
    173173  USE dynredem_mod, ONLY: dynredem_write_u, dynredem_write_v, dynredem_read_u, &
    174                           err, modname, fil, msg
     174          err, modname, fil, msg
    175175  USE temps_mod, ONLY: itau_dyn, itaufin
    176176  USE lmdz_description, ONLY: descript
    177  
     177  USE lmdz_iniprint, ONLY: lunout, prt_level
     178
    178179  IMPLICIT NONE
    179180  include "dimensions.h"
    180181  include "paramet.h"
    181182  include "comgeom.h"
    182   include "iniprint.h"
    183 !===============================================================================
    184 ! Arguments:
    185   CHARACTER(LEN=*), INTENT(IN) :: fichnom              !-- FILE NAME
    186   REAL, INTENT(IN)    ::  time                         !-- TIME
    187   REAL, INTENT(IN)    ::  vcov(ijb_v:ije_v,llm)        !-- V COVARIANT WIND
    188   REAL, INTENT(IN)    ::  ucov(ijb_u:ije_u,llm)        !-- U COVARIANT WIND
    189   REAL, INTENT(IN)    ::  teta(ijb_u:ije_u,llm)        !-- POTENTIAL TEMPERATURE
    190   REAL, INTENT(INOUT) ::     q(ijb_u:ije_u,llm,nqtot)  !-- TRACERS
    191   REAL, INTENT(IN)    :: masse(ijb_u:ije_u,llm)        !-- MASS PER CELL
    192   REAL, INTENT(IN)    ::    ps(ijb_u:ije_u)            !-- GROUND PRESSURE
    193 !===============================================================================
    194 ! Local variables:
     183  !===============================================================================
     184  ! Arguments:
     185  CHARACTER(LEN = *), INTENT(IN) :: fichnom              !-- FILE NAME
     186  REAL, INTENT(IN) :: time                         !-- TIME
     187  REAL, INTENT(IN) :: vcov(ijb_v:ije_v, llm)        !-- V COVARIANT WIND
     188  REAL, INTENT(IN) :: ucov(ijb_u:ije_u, llm)        !-- U COVARIANT WIND
     189  REAL, INTENT(IN) :: teta(ijb_u:ije_u, llm)        !-- POTENTIAL TEMPERATURE
     190  REAL, INTENT(INOUT) :: q(ijb_u:ije_u, llm, nqtot)  !-- TRACERS
     191  REAL, INTENT(IN) :: masse(ijb_u:ije_u, llm)        !-- MASS PER CELL
     192  REAL, INTENT(IN) :: ps(ijb_u:ije_u)            !-- GROUND PRESSURE
     193  !===============================================================================
     194  ! Local variables:
    195195  INTEGER :: iq, nid, vID, ierr, nid_trac, vID_trac
    196   INTEGER, SAVE :: nb=0
    197   INTEGER, PARAMETER :: length=100
    198   REAL               :: tab_cntrl(length) ! tableau des parametres du run
    199   CHARACTER(LEN=maxlen) :: var, dum
    200   LOGICAL            :: lread_inca
    201 !===============================================================================
    202 
    203 !$OMP MASTER
     196  INTEGER, SAVE :: nb = 0
     197  INTEGER, PARAMETER :: length = 100
     198  REAL :: tab_cntrl(length) ! tableau des parametres du run
     199  CHARACTER(LEN = maxlen) :: var, dum
     200  LOGICAL :: lread_inca
     201  !===============================================================================
     202
     203  !$OMP MASTER
    204204  IF(mpi_rank==0) THEN !++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    205   modname='dynredem1_loc'; fil=fichnom
    206   CALL err(nf90_open(fil,nf90_write,nid),"open",fil)
    207 
    208 !--- Write/extend time coordinate
    209   nb = nb + 1
    210   var="temps"
    211   CALL err(nf90_inq_varid(nid,var,vID),"inq",var)
    212   CALL err(nf90_put_var(nid,vID,[time]),"put",var)
    213   WRITE(lunout,*)TRIM(modname)//": Saving for ", nb, time
    214 
    215 !--- Rewrite control table (itaufin undefined in dynredem0)
    216   var="controle"
    217   CALL err(nf90_inq_varid(nid,var,vID),"inq",var)
    218   CALL err(nf90_get_var(nid,vID,tab_cntrl),"get",var)
    219   tab_cntrl(31)=DBLE(itau_dyn + itaufin)
    220   CALL err(nf90_inq_varid(nid,var,vID),"inq",var)
    221   CALL err(nf90_put_var(nid,vID,tab_cntrl),"put",var)
     205    modname = 'dynredem1_loc'; fil = fichnom
     206    CALL err(nf90_open(fil, nf90_write, nid), "open", fil)
     207
     208    !--- Write/extend time coordinate
     209    nb = nb + 1
     210    var = "temps"
     211    CALL err(nf90_inq_varid(nid, var, vID), "inq", var)
     212    CALL err(nf90_put_var(nid, vID, [time]), "put", var)
     213    WRITE(lunout, *)TRIM(modname) // ": Saving for ", nb, time
     214
     215    !--- Rewrite control table (itaufin undefined in dynredem0)
     216    var = "controle"
     217    CALL err(nf90_inq_varid(nid, var, vID), "inq", var)
     218    CALL err(nf90_get_var(nid, vID, tab_cntrl), "get", var)
     219    tab_cntrl(31) = DBLE(itau_dyn + itaufin)
     220    CALL err(nf90_inq_varid(nid, var, vID), "inq", var)
     221    CALL err(nf90_put_var(nid, vID, tab_cntrl), "put", var)
    222222  END IF               !++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    223 !$OMP END MASTER
    224 
    225 !--- Save fields
    226   CALL dynredem_write_u(nid,"ucov" ,ucov ,llm)
    227   CALL dynredem_write_v(nid,"vcov" ,vcov ,llm)
    228   CALL dynredem_write_u(nid,"teta" ,teta ,llm)
    229   CALL dynredem_write_u(nid,"masse",masse,llm)
    230   CALL dynredem_write_u(nid,"ps"   ,ps   ,1)
    231 
    232 !--- Tracers in file "start_trac.nc" (added by Anne)
    233   lread_inca=.FALSE.
    234 !$OMP MASTER
    235   fil="start_trac.nc"
    236   IF(ANY(type_trac == ['inca','inco'])) INQUIRE(FILE=fil,EXIST=lread_inca)
    237   IF(lread_inca) CALL err(nf90_open(fil,nf90_nowrite,nid_trac),"open")
    238 !$OMP END MASTER
    239 !$OMP BARRIER
    240 
    241 !--- Save tracers
    242   DO iq=1,nqtot; var=TRIM(tracers(iq)%name); ierr=-1
    243     IF(lread_inca) THEN                  !--- Possibly read from "start_trac.nc"
    244 !$OMP MASTER     
    245       fil="start_trac.nc"
    246       ierr=nf90_inq_varid(nid_trac,var,vID_trac)
    247       dum='inq'; IF(ierr==nf90_noerr) dum='fnd'
    248       WRITE(lunout,*)msg(dum,var)
    249 !$OMP END MASTER
    250 !$OMP BARRIER
    251       IF(ierr==nf90_noerr) CALL dynredem_read_u(nid_trac,var,q(:,:,iq),llm)
    252     END IF
    253     fil=fichnom
    254     CALL dynredem_write_u(nid,var,q(:,:,iq),llm)
     223  !$OMP END MASTER
     224
     225  !--- Save fields
     226  CALL dynredem_write_u(nid, "ucov", ucov, llm)
     227  CALL dynredem_write_v(nid, "vcov", vcov, llm)
     228  CALL dynredem_write_u(nid, "teta", teta, llm)
     229  CALL dynredem_write_u(nid, "masse", masse, llm)
     230  CALL dynredem_write_u(nid, "ps", ps, 1)
     231
     232  !--- Tracers in file "start_trac.nc" (added by Anne)
     233  lread_inca = .FALSE.
     234  !$OMP MASTER
     235  fil = "start_trac.nc"
     236  IF(ANY(type_trac == ['inca', 'inco'])) INQUIRE(FILE = fil, EXIST = lread_inca)
     237  IF(lread_inca) CALL err(nf90_open(fil, nf90_nowrite, nid_trac), "open")
     238  !$OMP END MASTER
     239  !$OMP BARRIER
     240
     241  !--- Save tracers
     242  DO iq = 1, nqtot; var = TRIM(tracers(iq)%name); ierr = -1
     243  IF(lread_inca) THEN                  !--- Possibly read from "start_trac.nc"
     244    !$OMP MASTER
     245    fil = "start_trac.nc"
     246    ierr = nf90_inq_varid(nid_trac, var, vID_trac)
     247    dum = 'inq'; IF(ierr==nf90_noerr) dum = 'fnd'
     248    WRITE(lunout, *)msg(dum, var)
     249    !$OMP END MASTER
     250    !$OMP BARRIER
     251    IF(ierr==nf90_noerr) CALL dynredem_read_u(nid_trac, var, q(:, :, iq), llm)
     252  END IF
     253  fil = fichnom
     254  CALL dynredem_write_u(nid, var, q(:, :, iq), llm)
    255255  END DO
    256256
    257 !$OMP MASTER
     257  !$OMP MASTER
    258258  IF(mpi_rank==0) THEN !++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    259   CALL err(nf90_close(nid),"close")
    260   fil="start_trac.nc"
    261   IF(lread_inca) CALL err(nf90_close(nid_trac),"close")
     259    CALL err(nf90_close(nid), "close")
     260    fil = "start_trac.nc"
     261    IF(lread_inca) CALL err(nf90_close(nid_trac), "close")
    262262  END IF               !++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    263 !$OMP END MASTER
     263  !$OMP END MASTER
    264264
    265265END SUBROUTINE dynredem1_loc
Note: See TracChangeset for help on using the changeset viewer.