Ignore:
Timestamp:
Jul 9, 2014, 4:43:31 PM (10 years ago)
Author:
Ehouarn Millour
Message:
  • Minor fix in dyn3dpar/leapfrog_p.F , should call geopot_p and not geopot
  • Added a sanity check in iniacademic
  • Added flag "resetvarc" to trigger a reset of initial values in sortvarc
  • Removed "sortvarc0" since the job can now be done with "resetvarc" and having set flag resertvarc to true.

EM

Location:
LMDZ5/trunk/libf/dyn3d_common
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • LMDZ5/trunk/libf/dyn3d_common/caldyn0.F

    r1945 r2083  
    66     $  phi,w,pbaru,pbarv,time )
    77
     8      USE control_mod, ONLY: resetvarc
    89      IMPLICIT NONE
    910
     
    8384      ENDDO
    8485
    85         CALL sortvarc0
     86      resetvarc=.true. ! force a recomputation of initial values in sortvarc
     87      CALL sortvarc
    8688     $ ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov )
    8789
  • LMDZ5/trunk/libf/dyn3d_common/control_mod.F90

    r1952 r2083  
    1010  IMPLICIT NONE
    1111
    12   REAL    :: periodav, starttime
    13   INTEGER :: nday,day_step,iperiod,iapp_tracvl,nsplit_phys
    14   INTEGER :: iconser,iecri,dissip_period,iphysiq,iecrimoy
    15   INTEGER :: dayref,anneeref, raz_date, ip_ebil_dyn
    16   LOGICAL :: offline
    17   CHARACTER (len=4)  :: config_inca
    18   CHARACTER (len=10) :: planet_type ! planet type ('earth','mars',...)
    19   LOGICAL output_grads_dyn ! output dynamics diagnostics in
    20                            ! binary grads file 'dyn.dat' (y/n)
    21   LOGICAL ok_dynzon  ! output zonal transports in dynzon.nc file
    22   LOGICAL ok_dyn_ins ! output instantaneous values of fields
    23                      ! in the dynamics in NetCDF files dyn_hist*nc
    24   LOGICAL ok_dyn_ave ! output averaged values of fields in the dynamics
    25                      ! in NetCDF files dyn_hist*ave.nc
     12  REAL,SAVE :: periodav
     13  REAL,SAVE :: starttime
     14  INTEGER,SAVE :: nday ! # of days to run
     15  INTEGER,SAVE :: day_step ! # of dynamical time steps per day
     16  INTEGER,SAVE :: iperiod ! make a Matsuno step before avery iperiod-1 LF steps
     17  INTEGER,SAVE :: iapp_tracvl ! apply (cumulated) traceur advection every
     18                              ! iapp_tracvl dynamical steps
     19  INTEGER,SAVE :: nsplit_phys ! number of sub-cycle steps in call to physics
     20  INTEGER,SAVE :: iconser
     21  INTEGER,SAVE :: iecri
     22  INTEGER,SAVE :: dissip_period ! apply dissipation every dissip_period
     23                                ! dynamical step
     24  INTEGER,SAVE :: iphysiq ! call physics every iphysiq dynamical steps
     25  INTEGER,SAVE :: iecrimoy
     26  INTEGER,SAVE :: dayref
     27  INTEGER,SAVE :: anneeref ! reference year #
     28  INTEGER,SAVE :: raz_date
     29  INTEGER,SAVE :: ip_ebil_dyn
     30  LOGICAL,SAVE :: offline
     31  CHARACTER(len=4),SAVE :: config_inca
     32  CHARACTER(len=10),SAVE :: planet_type ! planet type ('earth','mars',...)
     33  LOGICAL,SAVE :: output_grads_dyn ! output dynamics diagnostics in
     34                                   ! binary grads file 'dyn.dat' (y/n)
     35  LOGICAL,SAVE :: ok_dynzon  ! output zonal transports in dynzon.nc file
     36  LOGICAL,SAVE ::  ok_dyn_ins ! output instantaneous values of fields
     37                              ! in the dynamics in NetCDF files dyn_hist*nc
     38  LOGICAL,SAVE :: ok_dyn_ave ! output averaged values of fields in the dynamics
     39                             ! in NetCDF files dyn_hist*ave.nc
     40  LOGICAL,SAVE :: resetvarc  ! allows to reset the variables in sortvarc
    2641
    2742END MODULE
  • LMDZ5/trunk/libf/dyn3d_common/sortvarc.F

    r1952 r2083  
    55     $(itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time ,
    66     $ vcov )
     7
     8      USE control_mod, ONLY: resetvarc
    79      IMPLICIT NONE
     10
    811
    912c=======================================================================
     
    2225c   -------------
    2326
    24 #include "dimensions.h"
    25 #include "paramet.h"
    26 #include "comconst.h"
    27 #include "comvert.h"
    28 #include "comgeom.h"
    29 #include "ener.h"
    30 #include "logic.h"
    31 #include "temps.h"
     27      INCLUDE "dimensions.h"
     28      INCLUDE "paramet.h"
     29      INCLUDE "comconst.h"
     30      INCLUDE "comvert.h"
     31      INCLUDE "comgeom.h"
     32      INCLUDE "ener.h"
     33      INCLUDE "logic.h"
     34      INCLUDE "temps.h"
     35      INCLUDE "iniprint.h"
    3236
    3337c   Arguments:
    3438c   ----------
    3539
    36       INTEGER itau
    37       REAL ucov(ip1jmp1,llm),teta(ip1jmp1,llm),masse(ip1jmp1,llm)
    38       REAL vcov(ip1jm,llm)
    39       REAL ps(ip1jmp1),phis(ip1jmp1)
    40       REAL vorpot(ip1jm,llm)
    41       REAL phi(ip1jmp1,llm),bern(ip1jmp1,llm)
    42       REAL dp(ip1jmp1)
    43       REAL time
    44       REAL pk(ip1jmp1,llm)
     40      INTEGER,INTENT(IN) :: itau
     41      REAL,INTENT(IN) :: ucov(ip1jmp1,llm)
     42      REAL,INTENT(IN) :: teta(ip1jmp1,llm)
     43      REAL,INTENT(IN) :: masse(ip1jmp1,llm)
     44      REAL,INTENT(IN) :: vcov(ip1jm,llm)
     45      REAL,INTENT(IN) :: ps(ip1jmp1)
     46      REAL,INTENT(IN) :: phis(ip1jmp1)
     47      REAL,INTENT(IN) :: vorpot(ip1jm,llm)
     48      REAL,INTENT(IN) :: phi(ip1jmp1,llm)
     49      REAL,INTENT(IN) :: bern(ip1jmp1,llm)
     50      REAL,INTENT(IN) :: dp(ip1jmp1)
     51      REAL,INTENT(IN) :: time
     52      REAL,INTENT(IN) :: pk(ip1jmp1,llm)
    4553
    4654c   Local:
     
    5159      REAL cosphi(ip1jm),omegcosp(ip1jm)
    5260      REAL dtvrs1j,rjour,heure,radsg,radomeg
    53       REAL rday, massebxy(ip1jm,llm)
     61      REAL massebxy(ip1jm,llm)
    5462      INTEGER  l, ij, imjmp1
    5563
    5664      REAL       SSUM
     65      LOGICAL,SAVE :: firstcal=.true.
     66      CHARACTER(LEN=*),PARAMETER :: modname="sortvarc"
    5767
    5868c-----------------------------------------------------------------------
     69! Ehouarn: when no initialization fields from file, resetvarc should be
     70!          set to false
     71       if (firstcal) then
     72         if (.not.read_start) then
     73           resetvarc=.true.
     74         endif
     75       endif
    5976
    6077       dtvrs1j   = dtvr/daysec
     
    115132     *               cosphi(ij)
    116133          ENDDO
    117           angl(l) = radsg *
     134          angl(l) = rad *
    118135     s    (SSUM(ip1jm-iip1,ge(iip2),1)-SSUM(jjm-1,ge(iip2),iip1))
    119136      ENDDO
     
    129146      ang   = SSUM(     llm,  angl, 1 )
    130147
    131 c      rday = REAL(INT ( day_ini + time ))
    132 c
    133        rday = REAL(INT(time-jD_ref-jH_ref))
    134       IF(ptot0.eq.0.)  THEN
    135          PRINT 3500, itau, rday, heure,time
    136          PRINT*,'WARNING!!! On recalcule les valeurs initiales de :'
    137          PRINT*,'ptot,rmsdpdt,etot,ztot,stot,rmsv,ang'
    138          PRINT *, ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
     148      IF (firstcal.and.resetvarc) then
     149         WRITE(lunout,3500) itau, rjour, heure, time
     150         WRITE(lunout,*) trim(modname),
     151     &     ' WARNING!!! Recomputing initial values of : '
     152         WRITE(lunout,*) 'ptot,rmsdpdt,etot,ztot,stot,rmsv,ang'
     153         WRITE(lunout,*) ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
    139154         etot0 = etot
    140155         ptot0 = ptot
     
    144159      END IF
    145160
    146       etot= etot/etot0
     161      ! compute relative changes in etot,... (except if 'reference' values
     162      ! are zero, which can happen when using iniacademic)
     163      if (etot0.ne.0) then
     164        etot= etot/etot0
     165      else
     166        etot=1.
     167      endif
    147168      rmsv= SQRT(rmsv/ptot)
    148       ptot= ptot/ptot0
    149       ztot= ztot/ztot0
    150       stot= stot/stot0
    151       ang = ang /ang0
    152 
    153 
    154       PRINT 3500, itau, rday, heure, time
    155       PRINT 4000, ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
    156 
    157       RETURN
     169      if (ptot0.ne.0) then
     170        ptot= ptot/ptot0
     171      else
     172        ptot=1.
     173      endif
     174      if (ztot0.ne.0) then
     175        ztot= ztot/ztot0
     176      else
     177        ztot=1.
     178      endif
     179      if (stot0.ne.0) then
     180        stot= stot/stot0
     181      else
     182        stot=1.
     183      endif
     184      if (ang0.ne.0) then
     185        ang = ang /ang0
     186      else
     187        ang=1.
     188      endif
     189
     190      firstcal = .false.
     191
     192      WRITE(lunout,3500) itau, rjour, heure, time
     193      WRITE(lunout,4000) ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
    158194
    1591953500   FORMAT(10("*"),4x,'pas',i7,5x,'jour',f9.0,'heure',f5.1,4x
Note: See TracChangeset for help on using the changeset viewer.