Ignore:
Timestamp:
Feb 16, 2011, 7:28:48 PM (14 years ago)
Author:
aslmd
Message:

LMD_MM_MARS: correction d'un possible probleme dans module_lmd_driver lorsque les champs sont sauves si la physique n'est pas appelee tous les pas de temps dynamique, lorsque des nests sont utilises (seul le compilateur ifort a semble detecter un tableau deja alloue). l'interface est maintenant modifiee en definissant des tableaux uniques dont l'une des dimensions est l'indice du nest. changement par ailleurs des outputs display qui ne sont plus des MAXVAL MINVAL (parfois affichage fantaisiste bien que les sorties soient parfaitement regulieres)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mesoscale/LMD_MM_MARS/SRC/WRFV2/phys/module_lmd_driver.F

    r65 r67  
    209209!**************************************************
    210210! IMPORTANT: pour travailler avec grid nesting
    211      mieux vaut ne pas utiliser de SAVE ??
     211une dimension supplementaire liee au nest
    212212!**************************************************
    213       REAL, DIMENSION(:), ALLOCATABLE, SAVE :: &
     213      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
    214214             dp_save
    215       REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: &
     215      REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: &
    216216             du_save, dv_save, dt_save
    217       REAL, DIMENSION(:,:,:), ALLOCATABLE, SAVE :: &
     217      REAL, DIMENSION(:,:,:,:), ALLOCATABLE, SAVE :: &
    218218             dq_save     
    219219
     
    327327      !firstcall=.false. ! just in case you'd want to get rid of the physics
    328328test=0
    329 ALLOCATE(dp_save(ngrid)) !! here are the arrays that would be useful to save physics tendencies
    330 ALLOCATE(du_save(ngrid,nlayer))
    331 ALLOCATE(dv_save(ngrid,nlayer))
    332 ALLOCATE(dt_save(ngrid,nlayer))     
    333 ALLOCATE(dq_save(ngrid,nlayer,nq))
    334 dp_save(:)=0.    !! initialize these arrays ...
    335 du_save(:,:)=0.
    336 dv_save(:,:)=0.
    337 dt_save(:,:)=0.   
    338 dq_save(:,:,:)=0.
     329
     330PRINT *, 'ALLOCATED dp_save ???', ALLOCATED( dp_save ), id
     331IF( .NOT. ALLOCATED( dp_save  ) ) THEN
     332   PRINT *, '**** check **** OK I ALLOCATE one save ARRAY for all NESTS ', max_dom, id
     333   !! here are the arrays that would be useful to save physics tendencies
     334   ALLOCATE(dp_save(ngrid,max_dom))
     335   ALLOCATE(du_save(ngrid,nlayer,max_dom))
     336   ALLOCATE(dv_save(ngrid,nlayer,max_dom))
     337   ALLOCATE(dt_save(ngrid,nlayer,max_dom))     
     338   ALLOCATE(dq_save(ngrid,nlayer,nq,max_dom))
     339   dp_save(:,:)=0.    !! initialize these arrays ...
     340   du_save(:,:,:)=0.
     341   dv_save(:,:,:)=0.
     342   dt_save(:,:,:)=0.
     343   dq_save(:,:,:,:)=0.
     344ENDIF
     345
    339346!! put here some general information you'd like to print just once
    340347    print *, 'TILES: ', i_start,i_end, j_start, j_end  ! numbers for simple runs, arrays for parallel runs
     
    411418
    412419print *, 'check dynamics'
    413 print *, 'u', MAXVAL(u), MINVAL(u)
    414 print *, 'v', MAXVAL(v), MINVAL(v)
    415 print *, 'w', MAXVAL(w), MINVAL(w)
    416 print *, 't', MAXVAL(t), MINVAL(t, MASK = t > 0)
     420  !!! in some cases, weird values are displayed
     421  !!! despite the fact that outputs are OK...
     422  !print *, 'u', MAXVAL(u), MINVAL(u)
     423  !print *, 'v', MAXVAL(v), MINVAL(v)
     424  !print *, 'w', MAXVAL(w), MINVAL(w)
     425  !print *, 't', MAXVAL(t), MINVAL(t, MASK = t > 0)
     426print *, 'u', u(10,1,10), u(10,15,10)
     427print *, 'v', v(10,1,10), v(10,15,10)
     428print *, 'w', w(10,1,10), w(10,15,10)
     429print *, 't', t(10,1,10), t(10,15,10)
    417430
    418431!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     
    494507IF (test.NE.0) THEN
    495508print *,'** Mars ** NO CALL FOR PHYSICS, go to next step...',test
    496 pdpsrf(:)=dp_save(:)
    497 pdu(:,:)=du_save(:,:)
    498 pdv(:,:)=dv_save(:,:)
    499 pdt(:,:)=dt_save(:,:)
    500 pdq(:,:,:)=dq_save(:,:,:)
    501         !!!!!TEST TEST
    502         !!!!!pour le nesting c est mieux de les mettre dans la physique, les SAVE
     509pdpsrf(:)=dp_save(:,id)
     510pdu(:,:)=du_save(:,:,id)
     511pdv(:,:)=dv_save(:,:,id)
     512pdt(:,:)=dt_save(:,:,id)
     513pdq(:,:,:)=dq_save(:,:,:,id)
    503514!!!
    504515!!! BIG LOOP : 2. calculate physical tendencies
     
    10041015! PHYSIQ TENDENCIES ARE SAVED TO BE SPLIT WITHIN INTERMEDIATE DYNAMICAL TIMESTEPS !
    10051016!---------------------------------------------------------------------------------!
    1006 dp_save(:)=pdpsrf(:)
    1007 du_save(:,:)=pdu(:,:)
    1008 dv_save(:,:)=pdv(:,:)
    1009 dt_save(:,:)=pdt(:,:)
    1010 dq_save(:,:,:)=pdq(:,:,:)
     1017dp_save(:,id)=pdpsrf(:)
     1018du_save(:,:,id)=pdu(:,:)
     1019dv_save(:,:,id)=pdv(:,:)
     1020dt_save(:,:,id)=pdt(:,:)
     1021dq_save(:,:,:,id)=pdq(:,:,:)
    10111022
    10121023ENDIF call_physics
     
    11131124PRINT *, '** Mars ** Results from LMD physics'
    11141125PRINT *, 'u non-zero tendencies'
    1115 PRINT *, 'max',MAXVAL(RUBLTEN, MASK=RUBLTEN/=0.),&
    1116         ' at',MAXLOC(RUBLTEN, MASK=RUBLTEN/=0.)
    1117 PRINT *, 'min',MINVAL(RUBLTEN, MASK=RUBLTEN/=0.),&
    1118         ' at',MINLOC(RUBLTEN, MASK=RUBLTEN/=0.)
     1126!!PRINT *, 'max',MAXVAL(RUBLTEN, MASK=RUBLTEN/=0.),&
     1127!!        ' at',MAXLOC(RUBLTEN, MASK=RUBLTEN/=0.)
     1128!!PRINT *, 'min',MINVAL(RUBLTEN, MASK=RUBLTEN/=0.),&
     1129!!        ' at',MINLOC(RUBLTEN, MASK=RUBLTEN/=0.)
     1130PRINT *, RUBLTEN(10,1,10), RUBLTEN(10,15,10)
    11191131PRINT *, 'v non-zero tendencies'
    1120 PRINT *, 'max',MAXVAL(RVBLTEN, MASK=RVBLTEN/=0.),&
    1121         ' at',MAXLOC(RVBLTEN, MASK=RVBLTEN/=0.)
    1122 PRINT *, 'min',MINVAL(RVBLTEN, MASK=RVBLTEN/=0.),&
    1123         ' at',MINLOC(RVBLTEN, MASK=RVBLTEN/=0.)
     1132!!PRINT *, 'max',MAXVAL(RVBLTEN, MASK=RVBLTEN/=0.),&
     1133!!        ' at',MAXLOC(RVBLTEN, MASK=RVBLTEN/=0.)
     1134!!PRINT *, 'min',MINVAL(RVBLTEN, MASK=RVBLTEN/=0.),&
     1135!!        ' at',MINLOC(RVBLTEN, MASK=RVBLTEN/=0.)
     1136PRINT *, RVBLTEN(10,1,10), RVBLTEN(10,15,10)
    11241137!!! STOP IF CRASH
    11251138!IF (MAXVAL(RUBLTEN, MASK=RUBLTEN/=0.) == 0.) STOP
Note: See TracChangeset for help on using the changeset viewer.