source: trunk/LMDZ.GENERIC/libf/phystd/surfini.F @ 832

Last change on this file since 832 was 787, checked in by aslmd, 12 years ago

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
File size: 2.3 KB
Line 
1      SUBROUTINE surfini(ngrid,nq,qsurf,psolaralb)
2
3      USE surfdat_h
4      USE tracer_h
5
6      IMPLICIT NONE
7c=======================================================================
8c
9c   creation des calottes pour l'etat initial
10c
11c=======================================================================
12c-----------------------------------------------------------------------
13c   Declarations:
14c   -------------
15#include "dimensions.h"
16#include "dimphys.h"
17#include "callkeys.h"
18c
19      INTEGER ngrid,ig,icap
20      INTEGER nq
21      REAL  piceco2(ngrid),psolaralb(ngrid)
22      REAL qsurf(ngrid,nq) !tracer on surface (kg/m2)
23
24      EXTERNAL ISMIN,ISMAX
25      INTEGER ISMIN,ISMAX
26c
27c=======================================================================
28
29c
30c     calcul de piceco2 (kg/m2) a l'etat initial
31c     ------------------------------------------
32
33      DO ig=1,ngrid
34         psolaralb(ig)=albedodat(ig)
35!         psolaralb(ig,2)=albedodat(ig)
36      ENDDO
37
38      PRINT*,'surfini: minimum des donnees albedo',
39     s     albedodat(ISMIN(ngrid,albedodat,1))
40      PRINT*,'surfini: maximum des donnees albedo',
41     s     albedodat(ISMAX(ngrid,albedodat,1))
42
43c      calcul de psolaralb
44c      -------------------
45!      DO ig=1,ngrid
46c        IF (water) THEN
47c          if (qsurf(ig,nq).gt.0.005) then
48c             psolaralb(ig,1) = 0.4
49c             psolaralb(ig,2) = 0.4
50c           endif
51c         ENDIF
52!      ENDDO ! of DO ig=1,ngrid     
53c IF there is more than 5 pr. um of h2o ice but no C02 ice, surface albedo is set to 0.4.
54
55      if (igcm_co2_ice.ne.0) then
56! Change Albedo if there is CO2 ice on the surface
57        DO ig=1,ngrid
58          IF (qsurf(ig,igcm_co2_ice) .GT. 0.) THEN
59             IF(ig.GT.ngrid/2+1) THEN
60                icap=2
61             ELSE
62                icap=1
63             ENDIF
64             psolaralb(ig) = albedice(icap)
65!             psolaralb(ig,2) =  albedice(icap)
66          END IF
67        ENDDO ! of DO ig=1,ngrid     
68      else
69        write(*,*) "surfini: No CO2 ice tracer on surface  ..."
70        write(*,*) "         and therefore no albedo change."
71      endif
72
73      PRINT*,'surfini: minimum des donnees albedo',
74     s     psolaralb(ISMIN(ngrid,psolaralb,1))
75      PRINT*,'surfini: maximum des donnees albedo',
76     s     psolaralb(ISMAX(ngrid,psolaralb,1))
77
78      RETURN
79      END
Note: See TracBrowser for help on using the repository browser.