Ignore:
Timestamp:
Apr 14, 2010, 4:03:19 PM (14 years ago)
Author:
Ehouarn Millour
Message:

Some cleanup and fixing the possibility to output fields in the dynamics, on the dynamical grids.

CLEANUPS:

  • arch-PW6_VARGAS.fcm : add potentially benefic compiling options
  • removed obsolete "control.h" in dyn3d/dyn3dpar (module control_mod.F90 is used instead)

OUTPUTS in the dynamics (3 sets of files, one for each grid: scalar, u, v):

  • removed "com_io_dyn.h" common; use module "com_io_dyn_mod.F90" instead
  • updated "initdynav.F","inithist.F","writehist.F" and "writedynav.F" in bibio: which field will be written is hard coded there.
  • flags "ok_dyn_ins" and "ok_dyn_ave" (loaded via conf_gcm.F) trigger output of fields in the dynamics: if ok_dyn_ins is true, then files "dyn_hist.nc", "dyn_histu.nc" and "dyn_histv.nc" are written (the frequency of the outputs is given by 'iecri' in run.def; values are written every 'iecri' dynamical step). if ok_dyn_ave is true then files "dyn_hist_ave.nc", "dyn_histu_ave.nc" and "dyn_histv_ave.nc" are written (the rate at which averages and made/written, in days, is given by 'periodav' in run.def).

EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3d/leapfrog.F

    r1299 r1357  
    6060#include "description.h"
    6161#include "serre.h"
    62 #include "com_io_dyn.h"
     62!#include "com_io_dyn.h"
    6363#include "iniprint.h"
    6464#include "academic.h"
     
    197197
    198198      itau = 0
    199 c$$$      iday = day_ini+itau/day_step
    200 c$$$      time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
    201 c$$$         IF(time.GT.1.) THEN
    202 c$$$          time = time-1.
    203 c$$$          iday = iday+1
    204 c$$$         ENDIF
     199c      iday = day_ini+itau/day_step
     200c      time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
     201c         IF(time.GT.1.) THEN
     202c          time = time-1.
     203c          iday = iday+1
     204c         ENDIF
    205205
    206206
     
    276276
    277277      IF( purmats ) THEN
     278      ! Purely Matsuno time stepping
    278279         IF( MOD(itau,iconser) .EQ.0.AND.  forward    ) conser = .TRUE.
    279280         IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE.
     
    281282     s          .and. iflag_phys.EQ.1                 ) apphys = .TRUE.
    282283      ELSE
     284      ! Leapfrog/Matsuno time stepping
    283285         IF( MOD(itau   ,iconser) .EQ. 0              ) conser = .TRUE.
    284286         IF( MOD(itau+1,idissip)  .EQ. 0              ) apdiss = .TRUE.
    285287         IF( MOD(itau+1,iphysiq).EQ.0.AND.iflag_phys.EQ.1) apphys=.TRUE.
    286288      END IF
     289
     290! Ehouarn: for Shallow Water case (ie: 1 vertical layer),
     291!          supress dissipation step
     292      if (llm.eq.1) then
     293        apdiss=.false.
     294      endif
    287295
    288296c-----------------------------------------------------------------------
     
    522530            IF(forward. OR. leapf) THEN
    523531              itau= itau + 1
    524 c$$$              iday= day_ini+itau/day_step
    525 c$$$              time= REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
    526 c$$$                IF(time.GT.1.) THEN
    527 c$$$                  time = time-1.
    528 c$$$                  iday = iday+1
    529 c$$$                ENDIF
     532c              iday= day_ini+itau/day_step
     533c              time= REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
     534c                IF(time.GT.1.) THEN
     535c                  time = time-1.
     536c                  iday = iday+1
     537c                ENDIF
    530538            ENDIF
    531539
     
    559567               IF (ok_dynzon) THEN
    560568#ifdef CPP_IOIPSL
    561 !                  CALL writedynav(histaveid, itau,vcov ,
    562 !     ,                 ucov,teta,pk,phi,q,masse,ps,phis)
    563                   CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav,
    564      ,                 ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q)
     569                 CALL bilan_dyn(2,dtvr*iperiod,dtvr*day_step*periodav,
     570     &                 ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q)
    565571#endif
    566572               END IF
    567 
    568             ENDIF
     573               IF (ok_dyn_ave) THEN
     574#ifdef CPP_IOIPSL
     575                 CALL writedynav(itau,vcov,
     576     &                 ucov,teta,pk,phi,q,masse,ps,phis)
     577#endif
     578               ENDIF
     579
     580            ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin))
    569581
    570582c-----------------------------------------------------------------------
     
    572584c   ------------------------------
    573585
    574             IF( MOD(itau,iecri         ).EQ.0) THEN
    575 c           IF( MOD(itau,iecri*day_step).EQ.0) THEN
    576 
     586            IF( MOD(itau,iecri).EQ.0) THEN
     587             ! Ehouarn: output only during LF or Backward Matsuno
     588             if (leapf.or.(.not.leapf.and.(.not.forward))) then
    577589              nbetat = nbetatdem
    578590              CALL geopot(ip1jmp1,teta,pk,pks,phis,phi)
     
    583595              enddo
    584596#ifdef CPP_IOIPSL
    585 c             CALL writehist(histid,histvid,itau,vcov,
    586 c     &                      ucov,teta,phi,q,masse,ps,phis)
     597              if (ok_dyn_ins) then
     598!               write(lunout,*) "leapfrog: call writehist, itau=",itau
     599               CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis)
     600!               call WriteField('ucov',reshape(ucov,(/iip1,jmp1,llm/)))
     601!               call WriteField('vcov',reshape(vcov,(/iip1,jjm,llm/)))
     602!              call WriteField('teta',reshape(teta,(/iip1,jmp1,llm/)))
     603!               call WriteField('ps',reshape(ps,(/iip1,jmp1/)))
     604!               call WriteField('masse',reshape(masse,(/iip1,jmp1,llm/)))
     605              endif ! of if (ok_dyn_ins)
    587606#endif
    588607! For some Grads outputs of fields
    589              if (output_grads_dyn) then
     608              if (output_grads_dyn) then
    590609#include "write_grads_dyn.h"
    591              endif
    592 
     610              endif
     611             endif ! of if (leapf.or.(.not.leapf.and.(.not.forward)))
    593612            ENDIF ! of IF(MOD(itau,iecri).EQ.0)
    594613
     
    645664
    646665             itau =  itau + 1
    647 c$$$             iday = day_ini+itau/day_step
    648 c$$$             time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
    649 c$$$
    650 c$$$                  IF(time.GT.1.) THEN
    651 c$$$                   time = time-1.
    652 c$$$                   iday = iday+1
    653 c$$$                  ENDIF
     666c             iday = day_ini+itau/day_step
     667c             time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
     668c
     669c                  IF(time.GT.1.) THEN
     670c                   time = time-1.
     671c                   iday = iday+1
     672c                  ENDIF
    654673
    655674               forward =  .FALSE.
     
    660679               GO TO 2
    661680
    662             ELSE ! of IF(forward)
     681            ELSE ! of IF(forward) i.e. backward step
    663682
    664683              IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
     
    671690               IF (ok_dynzon) THEN
    672691#ifdef CPP_IOIPSL
    673 !                  CALL writedynav(histaveid, itau,vcov ,
    674 !     ,                 ucov,teta,pk,phi,q,masse,ps,phis)
    675                   CALL bilan_dyn (2,dtvr*iperiod,dtvr*day_step*periodav,
    676      ,                 ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q)
    677 #endif
    678                END IF
     692                 CALL bilan_dyn(2,dtvr*iperiod,dtvr*day_step*periodav,
     693     &                 ps,masse,pk,pbaru,pbarv,teta,phi,ucov,vcov,q)
     694#endif
     695               ENDIF
     696               IF (ok_dyn_ave) THEN
     697#ifdef CPP_IOIPSL
     698                 CALL writedynav(itau,vcov,
     699     &                 ucov,teta,pk,phi,q,masse,ps,phis)
     700#endif
     701               ENDIF
    679702
    680703              ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin)
     
    690713                enddo
    691714#ifdef CPP_IOIPSL
    692 c               CALL writehist( histid, histvid, itau,vcov ,
    693 c    &                           ucov,teta,phi,q,masse,ps,phis)
     715              if (ok_dyn_ins) then
     716!                write(lunout,*) "leapfrog: call writehist (b)",
     717!     &                        itau,iecri
     718                CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis)
     719              endif ! of if (ok_dyn_ins)
    694720#endif
    695721! For some Grads outputs
Note: See TracChangeset for help on using the changeset viewer.