Ignore:
Timestamp:
Sep 19, 2012, 8:26:55 PM (12 years ago)
Author:
aslmd
Message:

LMDZ.GENERIC. (Sorry for long text but this is a quite major commit)

Paving the path for parallel computations. And moving towards a more flexible code.

Automatic allocation is used within all routines in phystd. No further mention to ngridmx and nqmx.

  1. ngridmx and nqmx are still used in LMDZ.GENERIC in the dyn3d part
  2. if the LMDZ4/LMDZ5 dynamical core is used, there is no more fixed dimensions ngridmx and nqmx --> a fully flexible parallel implementation is now possible (e.g. no need to recompile when changing numbers of processors)

The important stuff :

  • Compilation checked with ifort. OK with and without debug mode. No errors. Checked for: gcm, newstart, rcm1d, kcm1d
  • RUN GCM: Running an Earth test case. Comparison with previous revision --> debug mode : perfect match. bit by bit (diff command). checked with plots --> O1 mode : close match (checked with plots) --> O2 mode : sometimes up to 0.5 K departure.... BUT in this new version O2 and O1 are quite close while in previous version O1 and O2 differed by about, well, typically 0.5 K (pictures available on request)
  • RUN NEWSTART : perfect match (bit-by-bit) in either debug or normal mode.
  • RUN RCM1D : perfect match in normal mode.
  • RUN KCM1D : not tested (I don't know what is the use of kcm1d)

List of main changes :

  • Additional arguments to some subroutines (ngrid and nq)
  • F77 include strategy is obsolete and replaced by F90 module strategy In this new strategy arrays are allocatable and allocated once at first use This has to be done for all common featuring arrays defined with ngridmx or nqmx

surfdat.h >> surfdat_h.F90
tracer.h >> tracer_h.F90
comsaison.h >> comsaison_h.F90
comgeomfi.h >> comgeomfi_h.F90
comsoil.h >> comsoil_h.F90
comdiurn.h >> comdiurn_h.F90
fisice.h >> DELETED. was not used. probably a fossil.
watercap.h >> DELETED. variable put in surfdat_h.F90

  • F77 'save' strategy is obsolete and replaced by F90 'allocatable save' strategy (see previous point and e.g. new version of physiq.F90)
  • Suppressing any mention to advtrac.h which is a common in the dynamics and needs nqmx This was easily solved by adding an argument with tracer names, coming from the dynamics This is probably not a definitive solution, ... but this allows for generic physics to work easily with either LMDZ.GENERIC or LMDZ dynamical cores
  • Removing consistency tests between nq and nqmx ; and ngrid and ngridmx. No use now!
  • Adaptation of rcm1d, kcm1d, newstart given above-mentioned changes

A note on phyetat0 and soil_setting:

  • Now written so that a slice of horizontal size 'ngrid' starting at grid point 'cursor' is read in startfi.nc 'cursor' is defined in dimphys.h and initialized by inifis (or in newstart) this is useful for parallel computations. default behavior is the usual one : sequential runs, cursor is 1, size ngrid is the whole global domain

A note on an additional change :

  • nueffrad is now an argument to callcorrk as is the case for reffrad both are saved in physiq this is for consistency and lisibility (previously nueffrad was saved in callcorrk) ... but there is a call to a function which modifies nueffrad in physiq ... previously this was not modifying nueffrad (although it was quite cumbersome to detect this) ... to be conservative I kept this behaviour and highlighted it with an array nueffrad_dummy ... I added a comment because someone might want to change this
Location:
trunk/LMDZ.GENERIC/libf/dyn3d
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/dyn3d/calfis.F

    r751 r787  
    7272#include "comgeom2.h"
    7373#include "control.h"
     74
     75#include "advtrac.h"
     76!! this is to get tnom (tracers name)
    7477
    7578c    Arguments :
     
    422425
    423426      CALL physiq (ngridmx,llm,nq,
     427     .     tnom,
    424428     ,     debut,lafin,
    425429     ,     rday_ecri,heure,dtphys,
  • trunk/LMDZ.GENERIC/libf/dyn3d/ini_archive.F

    r711 r787  
    3434
    3535c=======================================================================
     36
     37      USE comsoil_h
    3638 
    3739      implicit none
     
    4951#include "serre.h"
    5052#include "control.h"
    51 #include"comsoil.h"
    5253
    5354#include "netcdf.inc"
  • trunk/LMDZ.GENERIC/libf/dyn3d/lect_start_archive.F

    r588 r787  
    33     &     q,qsurf,surfith,nid)
    44
     5      USE surfdat_h
     6      USE comsoil_h
     7      USE tracer_h
     8
    59c=======================================================================
    610c
     
    2226#include "dimensions.h"
    2327#include "dimphys.h"
    24 #include "surfdat.h"
    25 #include "comsoil.h"
    2628#include "planete.h"
    2729#include "paramet.h"
     
    3638#include "lmdstd.h"
    3739#include "netcdf.inc"
    38 #include "tracer.h"
    3940#include"advtrac.h"
    4041c=======================================================================
  • trunk/LMDZ.GENERIC/libf/dyn3d/newstart.F

    r699 r787  
    1515c=======================================================================
    1616
     17      USE tracer_h
     18      USE comsoil_h
     19      USE surfdat_h
     20      USE comgeomfi_h
     21
    1722      implicit none
    1823
    1924#include "dimensions.h"
    2025#include "dimphys.h"
    21 #include "surfdat.h"
    22 #include "comsoil.h"
    2326#include "planete.h"
    2427#include "paramet.h"
     
    3740#include "netcdf.inc"
    3841#include "advtrac.h"
    39 #include "tracer.h"
    4042c=======================================================================
    4143c   Declarations
     
    243245      ! tnom(:) now contains tracer names
    244246! JL12 we will need the tracer names to read start in dyneta0
     247
     248! Initialize global tracer indexes (stored in tracer.h)
     249! ... this has to be done before phyetat0
     250      call initracer(ngridmx,nqmx,tnom)
     251
    245252
    246253c-----------------------------------------------------------------------
     
    293300     .       ps,phis,time)
    294301
     302
     303        ! ALLOCATE ARRAYS IN comgeomfi_h (done in inifis usually)
     304        IF (.not. ALLOCATED(lati)) ALLOCATE(lati(ngridmx))
     305        IF (.not. ALLOCATED(long)) ALLOCATE(long(ngridmx))
     306        IF (.not. ALLOCATED(area)) ALLOCATE(area(ngridmx))
     307        cursor = 1 ! added by AS in dimphys. 1 for sequential runs.
     308
    295309        write(*,*) 'Reading file STARTFI'
    296310        fichnom = 'startfi.nc'
    297         CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqmx,
     311        CALL phyetat0 (ngridmx,fichnom,tab0,Lmodif,nsoilmx,nqmx,
    298312     .        day_ini,time,
    299313     .        tsurf,tsoil,emis,q2,qsurf,   !) ! temporary modif by RDW
     
    352366c-----------------------------------------------------------------------
    353367      if (choix_1.eq.0) then
    354          call tabfi (nid,Lmodif,tab0,day_ini,lllm,p_rad,
     368         call tabfi (ngridmx,nid,Lmodif,tab0,day_ini,lllm,p_rad,
    355369     .            p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time)
    356370      else if (choix_1.eq.1) then
    357371         Lmodif=1 ! Lmodif set to 1 to allow modifications in phyeta0                           
    358          call tabfi (nid_fi,Lmodif,tab0,day_ini,lllm,p_rad,
     372         call tabfi (ngridmx,nid_fi,Lmodif,tab0,day_ini,lllm,p_rad,
    359373     .            p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time)
    360374      endif
     
    369383      kappa = 8.314*1000./(p_mugaz*p_cpp) ! added by RDW
    370384
    371 
    372385c=======================================================================
    373386c  INITIALISATIONS DIVERSES
    374387c=======================================================================
    375 ! Initialize global tracer indexes (stored in tracer.h)
    376       call initracer()
    377388! Load parameters from run.def file
    378389      CALL defrun_new( 99, .TRUE. )
     
    14131424
    14141425
    1415       call physdem1("restartfi.nc",lonfi,latfi,nsoilmx,nqmx,
     1426      call physdem1(ngridmx,"restartfi.nc",lonfi,latfi,nsoilmx,nqmx,
    14161427     .              dtphys,float(day_ini),
    14171428     .              time,tsurf,tsoil,emis,q2,qsurf,
    14181429     .              airefi,albfi,ithfi,zmea,zstd,zsig,zgam,zthe,
    1419      .              cloudfrac,totalfrac,hice)
     1430     .              cloudfrac,totalfrac,hice,tnom)
    14201431
    14211432c=======================================================================
  • trunk/LMDZ.GENERIC/libf/dyn3d/start2archive.F

    r711 r787  
    1818c
    1919c=======================================================================
     20
     21      USE comsoil_h
    2022
    2123      implicit none
     
    3436
    3537#include "dimphys.h"
    36 #include "comsoil.h"
    3738#include "planete.h"
    3839#include"advtrac.h"
     
    162163      Lmodif=0
    163164
    164       CALL phyetat0 (fichnom,0,Lmodif,nsoilmx,nqmx,day_ini_fi,timefi,
     165      CALL phyetat0 (ngridmx,fichnom,0,Lmodif,nsoilmx,nqmx,day_ini_fi,
     166     .      timefi,
    165167     .      tsurf,tsoil,emis,q2,qsurf,
    166168!       change FF 05/2011
Note: See TracChangeset for help on using the changeset viewer.