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

Location:
LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar
Files:
2 added
2 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/conf_gcm.F

    r1325 r1357  
    601601      CALL getin('ok_dynzon',ok_dynzon)
    602602
     603!Config  Key  = ok_dyn_ins
     604!Config  Desc = sorties instantanees dans la dynamique
     605!Config  Def  = n
     606!Config  Help =
     607!Config         
     608      ok_dyn_ins = .FALSE.
     609      CALL getin('ok_dyn_ins',ok_dyn_ins)
     610
     611!Config  Key  = ok_dyn_ave
     612!Config  Desc = sorties moyennes dans la dynamique
     613!Config  Def  = n
     614!Config  Help =
     615!Config         
     616      ok_dyn_ave = .FALSE.
     617      CALL getin('ok_dyn_ave',ok_dyn_ave)
    603618
    604619      write(lunout,*)' #########################################'
     
    641656      write(lunout,*)' config_inca = ', config_inca
    642657      write(lunout,*)' ok_dynzon = ', ok_dynzon
     658      write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
     659      write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
    643660
    644661      RETURN
     
    773790      ok_dynzon = .FALSE.
    774791      CALL getin('ok_dynzon',ok_dynzon)
     792
     793!Config  Key  = ok_dyn_ins
     794!Config  Desc = sorties instantanees dans la dynamique
     795!Config  Def  = n
     796!Config  Help =
     797!Config         
     798      ok_dyn_ins = .FALSE.
     799      CALL getin('ok_dyn_ins',ok_dyn_ins)
     800
     801!Config  Key  = ok_dyn_ave
     802!Config  Desc = sorties moyennes dans la dynamique
     803!Config  Def  = n
     804!Config  Help =
     805!Config         
     806      ok_dyn_ave = .FALSE.
     807      CALL getin('ok_dyn_ave',ok_dyn_ave)
    775808
    776809!Config  Key  = use_filtre_fft
     
    866899      write(lunout,*)' config_inca = ', config_inca
    867900      write(lunout,*)' ok_dynzon = ', ok_dynzon
     901      write(lunout,*)' ok_dyn_ins = ', ok_dyn_ins
     902      write(lunout,*)' ok_dyn_ave = ', ok_dyn_ave
    868903      write(lunout,*)' use_filtre_fft = ', use_filtre_fft
    869904      write(lunout,*)' use_mpi_alloc = ', use_mpi_alloc
  • LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/control_mod.F90

    r1325 r1357  
    11!
    2 ! $Id$
     2! $Id $
    33!
    44
     
    1414  INTEGER :: iconser,iecri,idissip,iphysiq,iecrimoy
    1515  INTEGER :: dayref,anneeref, raz_date, ip_ebil_dyn
    16   LOGICAL :: offline, output_grads_dyn, ok_dynzon
     16  LOGICAL :: offline
    1717  CHARACTER (len=4)  :: config_inca
    18   CHARACTER (len=10) :: planet_type
     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
    1926
    2027END MODULE
  • LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/gcm.F

    r1333 r1357  
    7070#include "description.h"
    7171#include "serre.h"
    72 #include "com_io_dyn.h"
     72!#include "com_io_dyn.h"
    7373#include "iniprint.h"
    7474#include "tracstoke.h"
     75#ifdef INCA
     76! Only INCA needs these informations (from the Earth's physics)
    7577#include "indicesol.h"
     78#endif
    7679
    7780      INTEGER         longcles
     
    335338     .  ' restart ne correspondent pas a celles lues dans '
    336339        write(lunout,*)' gcm.def'
    337         write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
    338         write(lunout,*)' day_ref=',day_ref," dayref=",dayref
    339         write(lunout,*)' Pas de remise a zero'
     340        write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
     341        write(lunout,*)' day_ref=',day_ref," dayref=",dayref
     342        write(lunout,*)' Pas de remise a zero'
    340343      ENDIF
    341 c$$$      if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then
    342 c$$$        write(lunout,*)
    343 c$$$     .  'GCM: Attention les dates initiales lues dans le fichier'
    344 c$$$        write(lunout,*)
    345 c$$$     .  ' restart ne correspondent pas a celles lues dans '
    346 c$$$        write(lunout,*)' gcm.def'
    347 c$$$    write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
    348 c$$$    write(lunout,*)' day_ref=',day_ref," dayref=",dayref
    349 c$$$        if (raz_date .ne. 1) then
    350 c$$$          write(lunout,*)
    351 c$$$     .    'GCM: On garde les dates du fichier restart'
    352 c$$$        else
    353 c$$$          annee_ref = anneeref
    354 c$$$          day_ref = dayref
    355 c$$$          day_ini = dayref
    356 c$$$          itau_dyn = 0
    357 c$$$          itau_phy = 0
    358 c$$$          time_0 = 0.
    359 c$$$          write(lunout,*)
    360 c$$$     .   'GCM: On reinitialise a la date lue dans gcm.def'
    361 c$$$        endif
    362 c$$$      ELSE
    363 c$$$        raz_date = 0
    364 c$$$      endif
     344c      if (annee_ref .ne. anneeref .or. day_ref .ne. dayref) then
     345c        write(lunout,*)
     346c     .  'GCM: Attention les dates initiales lues dans le fichier'
     347c        write(lunout,*)
     348c     .  ' restart ne correspondent pas a celles lues dans '
     349c        write(lunout,*)' gcm.def'
     350c        write(lunout,*)' annee_ref=',annee_ref," anneeref=",anneeref
     351c        write(lunout,*)' day_ref=',day_ref," dayref=",dayref
     352c        if (raz_date .ne. 1) then
     353c          write(lunout,*)
     354c     .    'GCM: On garde les dates du fichier restart'
     355c        else
     356c          annee_ref = anneeref
     357c          day_ref = dayref
     358c          day_ini = dayref
     359c          itau_dyn = 0
     360c          itau_phy = 0
     361c          time_0 = 0.
     362c          write(lunout,*)
     363c     .   'GCM: On reinitialise a la date lue dans gcm.def'
     364c        endif
     365c      ELSE
     366c        raz_date = 0
     367c      endif
    365368
    366369#ifdef CPP_IOIPSL
     
    486489
    487490#ifdef CPP_IOIPSL
    488       if ( 1.eq.1) then
    489491      time_step = zdtvr
    490       t_ops = iecri * daysec
    491       t_wrt = iecri * daysec
     492      if (ok_dyn_ins) then
     493        ! initialize output file for instantaneous outputs
     494        ! t_ops = iecri * daysec ! do operations every t_ops
     495        t_ops =((1.0*iecri)/day_step) * daysec 
     496        t_wrt = daysec ! iecri * daysec ! write output every t_wrt
     497        t_wrt = daysec ! iecri * daysec ! write output every t_wrt
     498        CALL inithist(day_ref,annee_ref,time_step,
     499     &              t_ops,t_wrt)
    492500!      CALL inithist_p(dynhist_file,day_ref,annee_ref,time_step,
    493501!     .              t_ops, t_wrt, histid, histvid)
    494 
    495       IF (ok_dynzon) THEN
    496          t_ops = iperiod * time_step
    497          t_wrt = periodav * daysec
     502      endif
     503
     504      IF (ok_dyn_ave) THEN
     505        ! initialize output file for averaged outputs
     506        t_ops = iperiod * time_step ! do operations every t_ops
     507        t_wrt = periodav * daysec   ! write output every t_wrt
     508        CALL initdynav(day_ref,annee_ref,time_step,
     509     &       t_ops,t_wrt)
    498510!         CALL initdynav_p(dynhistave_file,day_ref,annee_ref,time_step,
    499511!     .        t_ops, t_wrt, histaveid)
    500512      END IF
    501513      dtav = iperiod*dtvr/daysec
    502       endif
    503 
    504 
    505514#endif
    506515! #endif of #ifdef CPP_IOIPSL
  • LMDZ4/branches/LMDZ4V5.0-dev/libf/dyn3dpar/leapfrog_p.F

    r1322 r1357  
    6666#include "description.h"
    6767#include "serre.h"
    68 #include "com_io_dyn.h"
     68!#include "com_io_dyn.h"
    6969#include "iniprint.h"
    7070#include "academic.h"
     
    352352c      idissip=1
    353353      IF( purmats ) THEN
     354      ! Purely Matsuno time stepping
    354355         IF( MOD(itau,iconser) .EQ.0.AND.  forward    ) conser = .TRUE.
    355356         IF( MOD(itau,idissip ).EQ.0.AND..NOT.forward ) apdiss = .TRUE.
     
    357358     s          .and. iflag_phys.EQ.1                 ) apphys = .TRUE.
    358359      ELSE
     360      ! Leapfrog/Matsuno time stepping
    359361         IF( MOD(itau   ,iconser) .EQ. 0              ) conser = .TRUE.
    360362         IF( MOD(itau+1,idissip)  .EQ. 0              ) apdiss = .TRUE.
     
    362364      END IF
    363365
     366! Ehouarn: for Shallow Water case (ie: 1 vertical layer),
     367!          supress dissipation step
     368      if (llm.eq.1) then
     369        apdiss=.false.
     370      endif
     371
    364372cym    ---> Pour le moment     
    365373cym      apphys = .FALSE.
    366374      statcl = .FALSE.
    367       conser = .FALSE.
     375      conser = .FALSE. ! ie: no output of control variables to stdout in //
    368376     
    369377      if (firstCaldyn) then
     
    974982c$OMP BARRIER
    975983       call WaitRequest(Request_Physic)     
    976 
     984c$OMP BARRIER
    977985       call friction_p(ucov,vcov,iphysiq*dtvr)
    978986      ENDIF ! of IF(iflag_phys.EQ.2)
     
    10911099            enddo
    10921100c$OMP END DO NOWAIT           
    1093        endif
     1101       endif ! of if (dissip_conservative)
    10941102
    10951103       ijb=ij_begin
     
    12001208c$OMP END MASTER
    12011209c$OMP BARRIER
    1202       END IF
     1210      END IF ! of IF(apdiss)
    12031211
    12041212cc$OMP END PARALLEL
     
    13391347              ENDIF !ok_dynzon
    13401348#endif
    1341             ENDIF
     1349               IF (ok_dyn_ave) THEN
     1350!$OMP MASTER
     1351#ifdef CPP_IOIPSL
     1352! Ehouarn: Gather fields and make master send to output
     1353                call Gather_Field(vcov,ip1jm,llm,0)
     1354                call Gather_Field(ucov,ip1jmp1,llm,0)
     1355                call Gather_Field(teta,ip1jmp1,llm,0)
     1356                call Gather_Field(phi,ip1jmp1,llm,0)
     1357                do iq=1,nqtot
     1358                  call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
     1359                enddo
     1360                call Gather_Field(masse,ip1jmp1,llm,0)
     1361                call Gather_Field(ps,ip1jmp1,1,0)
     1362                call Gather_Field(phis,ip1jmp1,1,0)
     1363                if (mpi_rank==0) then
     1364                 CALL writedynav(itau,vcov,
     1365     &                 ucov,teta,pk,phi,q,masse,ps,phis)
     1366                endif
     1367#endif
     1368!$OMP END MASTER
     1369               ENDIF ! of IF (ok_dyn_ave)
     1370            ENDIF ! of IF((MOD(itau,iperiod).EQ.0).OR.(itau.EQ.itaufin))
    13421371
    13431372c-----------------------------------------------------------------------
     
    13451374c   ------------------------------
    13461375
    1347 c      IF( MOD(itau,iecri         ).EQ.0) THEN
    1348 
    1349             IF( MOD(itau,iecri*day_step).EQ.0) THEN
     1376            IF( MOD(itau,iecri).EQ.0) THEN
     1377             ! Ehouarn: output only during LF or Backward Matsuno
     1378             if (leapf.or.(.not.leapf.and.(.not.forward))) then
    13501379c$OMP BARRIER
    13511380c$OMP MASTER
     
    13811410       
    13821411#ifdef CPP_IOIPSL
    1383  
     1412              if (ok_dyn_ins) then
     1413! Ehouarn: Gather fields and make master write to output
     1414                call Gather_Field(vcov,ip1jm,llm,0)
     1415                call Gather_Field(ucov,ip1jmp1,llm,0)
     1416                call Gather_Field(teta,ip1jmp1,llm,0)
     1417                call Gather_Field(phi,ip1jmp1,llm,0)
     1418                do iq=1,nqtot
     1419                  call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
     1420                enddo
     1421                call Gather_Field(masse,ip1jmp1,llm,0)
     1422                call Gather_Field(ps,ip1jmp1,1,0)
     1423                call Gather_Field(phis,ip1jmp1,1,0)
     1424                if (mpi_rank==0) then
     1425                 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis)
     1426                endif
    13841427!              CALL writehist_p(histid,histvid, itau,vcov,
    13851428!     &                         ucov,teta,phi,q,masse,ps,phis)
    1386 
     1429! or use writefield_p
     1430!      call WriteField_p('ucov',reshape(ucov,(/iip1,jmp1,llm/)))
     1431!      call WriteField_p('vcov',reshape(vcov,(/iip1,jjm,llm/)))
     1432!      call WriteField_p('teta',reshape(teta,(/iip1,jmp1,llm/)))
     1433!      call WriteField_p('ps',reshape(ps,(/iip1,jmp1/)))
     1434              endif ! of if (ok_dyn_ins)
    13871435#endif
    13881436! For some Grads outputs of fields
     
    14011449              endif ! of if (output_grads_dyn)
    14021450c$OMP END MASTER
     1451             endif ! of if (leapf.or.(.not.leapf.and.(.not.forward)))
    14031452            ENDIF ! of IF(MOD(itau,iecri).EQ.0)
    14041453
     
    14791528               GO TO 2
    14801529
    1481             ELSE ! of IF(forward)
     1530            ELSE ! of IF(forward) i.e. backward step
    14821531
    14831532              IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin) THEN
     
    14901539               IF (ok_dynzon) THEN
    14911540c$OMP BARRIER
    1492 
    14931541               call Register_Hallo(vcov,ip1jm,llm,1,0,0,1,TestRequest)
    14941542               call SendRequest(TestRequest)
    14951543c$OMP BARRIER
    14961544               call WaitRequest(TestRequest)
    1497 
    14981545c$OMP BARRIER
    14991546c$OMP MASTER
     
    15051552               END IF !ok_dynzon
    15061553#endif
     1554               IF (ok_dyn_ave) THEN
     1555!$OMP MASTER
     1556#ifdef CPP_IOIPSL
     1557! Ehouarn: Gather fields and make master send to output
     1558                call Gather_Field(vcov,ip1jm,llm,0)
     1559                call Gather_Field(ucov,ip1jmp1,llm,0)
     1560                call Gather_Field(teta,ip1jmp1,llm,0)
     1561                call Gather_Field(phi,ip1jmp1,llm,0)
     1562                do iq=1,nqtot
     1563                  call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
     1564                enddo
     1565                call Gather_Field(masse,ip1jmp1,llm,0)
     1566                call Gather_Field(ps,ip1jmp1,1,0)
     1567                call Gather_Field(phis,ip1jmp1,1,0)
     1568                if (mpi_rank==0) then
     1569                 CALL writedynav(itau,vcov,
     1570     &                 ucov,teta,pk,phi,q,masse,ps,phis)
     1571                endif
     1572#endif
     1573!$OMP END MASTER
     1574               ENDIF ! of IF (ok_dyn_ave)
     1575
    15071576              ENDIF ! of IF(MOD(itau,iperiod).EQ.0 .OR. itau.EQ.itaufin)
    15081577
    15091578
    1510 c               IF(MOD(itau,iecri         ).EQ.0) THEN
    1511               IF(MOD(itau,iecri*day_step).EQ.0) THEN
     1579               IF(MOD(itau,iecri         ).EQ.0) THEN
     1580c              IF(MOD(itau,iecri*day_step).EQ.0) THEN
    15121581c$OMP BARRIER
    15131582c$OMP MASTER
     
    15421611
    15431612#ifdef CPP_IOIPSL
    1544 
     1613              if (ok_dyn_ins) then
     1614! Ehouarn: Gather fields and make master send to output
     1615                call Gather_Field(vcov,ip1jm,llm,0)
     1616                call Gather_Field(ucov,ip1jmp1,llm,0)
     1617                call Gather_Field(teta,ip1jmp1,llm,0)
     1618                call Gather_Field(phi,ip1jmp1,llm,0)
     1619                do iq=1,nqtot
     1620                  call Gather_Field(q(1,1,iq),ip1jmp1,llm,0)
     1621                enddo
     1622                call Gather_Field(masse,ip1jmp1,llm,0)
     1623                call Gather_Field(ps,ip1jmp1,1,0)
     1624                call Gather_Field(phis,ip1jmp1,1,0)
     1625                if (mpi_rank==0) then
     1626                 CALL writehist(itau,vcov,ucov,teta,phi,q,masse,ps,phis)
     1627                endif
    15451628!                CALL writehist_p(histid, histvid, itau,vcov ,
    15461629!     &                           ucov,teta,phi,q,masse,ps,phis)
     1630              endif ! of if (ok_dyn_ins)
    15471631#endif
    15481632! For some Grads output (but does it work?)
     
    15621646
    15631647c$OMP END MASTER
    1564               ENDIF ! of IF(MOD(itau,iecri*day_step).EQ.0)
     1648              ENDIF ! of IF(MOD(itau,iecri).EQ.0)
    15651649
    15661650              IF(itau.EQ.itaufin) THEN
Note: See TracChangeset for help on using the changeset viewer.