/[lmdze]/trunk/dyn3d/dynetat0.f
ViewVC logotype

Diff of /trunk/dyn3d/dynetat0.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 312 by guez, Fri Dec 7 14:17:11 2018 UTC revision 313 by guez, Mon Dec 10 15:54:30 2018 UTC
# Line 6  module dynetat0_m Line 6  module dynetat0_m
6    
7    private iim, jjm, principal_cshift, invert_zoom_x, funcd    private iim, jjm, principal_cshift, invert_zoom_x, funcd
8    
9    INTEGER, protected:: day_ini    INTEGER, protected, save:: day_ini
10    ! day number at the beginning of the run, based at value 1 on    ! day number at the beginning of the run, based at value 1 on
11    ! January 1st of annee_ref    ! January 1st of annee_ref
12    
13    integer:: day_ref = 1 ! jour de l'ann\'ee de l'\'etat initial    real, protected, save:: rlatu(jjm + 1)
   ! (= 350 si 20 d\'ecembre par exemple)  
   
   integer:: annee_ref = 1998 ! Annee de l'etat initial (avec 4 chiffres)  
   
   REAL, protected:: clon ! longitude of the center of the zoom, in rad  
   real, protected:: clat ! latitude of the center of the zoom, in rad  
   
   real, protected:: grossismx, grossismy  
   ! facteurs de grossissement du zoom, selon la longitude et la latitude  
   ! = 2 si 2 fois, = 3 si 3 fois, etc.  
   
   real, protected:: dzoomx, dzoomy  
   ! extensions en longitude et latitude de la zone du zoom (fractions  
   ! de la zone totale)  
   
   real, protected:: taux, tauy  
   ! raideur de la transition de l'int\'erieur \`a l'ext\'erieur du zoom  
     
   real, protected:: rlatu(jjm + 1)  
14    ! latitudes of points of the "scalar" and "u" grid, in rad    ! latitudes of points of the "scalar" and "u" grid, in rad
15    
16    real, protected:: rlatv(jjm)    real, protected, save:: rlatv(jjm)
17    ! latitudes of points of the "v" grid, in rad, in decreasing order    ! latitudes of points of the "v" grid, in rad, in decreasing order
18    
19    real, protected:: rlonu(iim + 1)    real, protected, save:: rlonu(iim + 1)
20    ! longitudes of points of the "u" grid, in rad    ! longitudes of points of the "u" grid, in rad
21    
22    real, protected:: rlonv(iim + 1)    real, protected, save:: rlonv(iim + 1)
23    ! longitudes of points of the "scalar" and "v" grid, in rad    ! longitudes of points of the "scalar" and "v" grid, in rad
24    
25    real, protected:: xprimu(iim + 1), xprimv(iim + 1)    real, protected, save:: xprimu(iim + 1), xprimv(iim + 1)
26    ! 2 pi / iim * (derivative of the longitudinal zoom function)(rlon[uv])    ! 2 pi / iim * (derivative of the longitudinal zoom function)(rlon[uv])
27    
28    REAL, protected:: xprimm025(iim + 1), xprimp025(iim + 1)    REAL, protected, save:: xprimm025(iim + 1), xprimp025(iim + 1)
29    REAL, protected:: rlatu1(jjm), rlatu2(jjm), yprimu1(jjm), yprimu2(jjm)    REAL, protected, save:: rlatu1(jjm), rlatu2(jjm), yprimu1(jjm), yprimu2(jjm)
30    REAL ang0, etot0, ptot0, ztot0, stot0    REAL, save:: ang0, etot0, ptot0, ztot0, stot0
31    INTEGER, PARAMETER, private:: nmax = 30000    INTEGER, PARAMETER, private:: nmax = 30000
32    DOUBLE PRECISION, private:: abs_y    DOUBLE PRECISION, private, save:: abs_y
33      INTEGER, save:: itau_dyn
   save  
34    
35  contains  contains
36    
# Line 60  contains Line 40  contains
40      ! Authors: P. Le Van, L. Fairhead      ! Authors: P. Le Van, L. Fairhead
41      ! This procedure reads the initial state of the atmosphere.      ! This procedure reads the initial state of the atmosphere.
42    
43      use comconst, only: dtvr      ! Libraries:
     use conf_gcm_m, only: raz_date  
     use dimensions, only: iim, jjm, llm, nqmx  
     use disvert_m, only: pa  
     use iniadvtrac_m, only: tname  
44      use netcdf, only: NF90_NOWRITE, NF90_NOERR      use netcdf, only: NF90_NOWRITE, NF90_NOERR
45      use netcdf95, only: NF95_GET_VAR, nf95_open, nf95_inq_varid, NF95_CLOSE, &      use netcdf95, only: NF95_GET_VAR, nf95_open, nf95_inq_varid, NF95_CLOSE, &
46           NF95_Gw_VAR           NF95_Gw_VAR
47      use nr_util, only: assert      use nr_util, only: assert
48      use temps, only: itau_dyn  
49      use unit_nml_m, only: unit_nml      use conf_gcm_m, only: raz_date
50        use dimensions, only: iim, jjm, llm, nqmx
51        use dynetat0_chosen_m, only: day_ref
52        use iniadvtrac_m, only: tname
53    
54      REAL, intent(out):: vcov(: , :, :) ! (iim + 1, jjm, llm)      REAL, intent(out):: vcov(: , :, :) ! (iim + 1, jjm, llm)
55      REAL, intent(out):: ucov(:, :, :) ! (iim + 1, jjm + 1, llm)      REAL, intent(out):: ucov(:, :, :) ! (iim + 1, jjm + 1, llm)
# Line 85  contains Line 64  contains
64      REAL, allocatable:: tab_cntrl(:) ! tableau des param\`etres du run      REAL, allocatable:: tab_cntrl(:) ! tableau des param\`etres du run
65      INTEGER ierr, ncid, varid      INTEGER ierr, ncid, varid
66    
     namelist /dynetat0_nml/ day_ref, annee_ref  
   
67      !-----------------------------------------------------------------------      !-----------------------------------------------------------------------
68    
69      print *, "Call sequence information: dynetat0"      print *, "Call sequence information: dynetat0"
# Line 106  contains Line 83  contains
83      call nf95_inq_varid(ncid, "controle", varid)      call nf95_inq_varid(ncid, "controle", varid)
84      call NF95_Gw_VAR(ncid, varid, tab_cntrl)      call NF95_Gw_VAR(ncid, varid, tab_cntrl)
85    
     call assert(int(tab_cntrl(1)) == iim, "dynetat0 tab_cntrl iim")  
     call assert(int(tab_cntrl(2)) == jjm, "dynetat0 tab_cntrl jjm")  
     call assert(int(tab_cntrl(3)) == llm, "dynetat0 tab_cntrl llm")  
   
     IF (dtvr /= tab_cntrl(12)) THEN  
        print *, 'Warning: the time steps from day_step and "start.nc" ' // &  
             'are different.'  
        print *, 'dtvr from day_step: ', dtvr  
        print *, 'dtvr from "start.nc": ', tab_cntrl(12)  
        print *, 'Using the value from day_step.'  
     ENDIF  
   
86      etot0 = tab_cntrl(13)      etot0 = tab_cntrl(13)
87      ptot0 = tab_cntrl(14)      ptot0 = tab_cntrl(14)
88      ztot0 = tab_cntrl(15)      ztot0 = tab_cntrl(15)
89      stot0 = tab_cntrl(16)      stot0 = tab_cntrl(16)
90      ang0 = tab_cntrl(17)      ang0 = tab_cntrl(17)
     pa = tab_cntrl(18)  
   
     clon = tab_cntrl(20)  
     clat = tab_cntrl(21)  
     grossismx = tab_cntrl(22)  
     grossismy = tab_cntrl(23)  
     dzoomx = tab_cntrl(25)  
     dzoomy = tab_cntrl(26)  
     taux = tab_cntrl(28)  
     tauy = tab_cntrl(29)  
   
     print *, "Enter namelist 'dynetat0_nml'."  
     read(unit=*, nml=dynetat0_nml)  
     write(unit_nml, nml=dynetat0_nml)  
91    
92      if (raz_date) then      if (raz_date) then
93         print *, 'Resetting the date, using the namelist.'         print *, 'Resetting the date.'
94         day_ini = day_ref         day_ini = day_ref
95         itau_dyn = 0         itau_dyn = 0
96      else      else
        day_ref = tab_cntrl(4)  
        annee_ref = tab_cntrl(5)  
97         itau_dyn = tab_cntrl(31)         itau_dyn = tab_cntrl(31)
98         day_ini = tab_cntrl(30)         day_ini = tab_cntrl(30)
99      end if      end if
# Line 225  contains Line 174  contains
174    
175    !********************************************************************    !********************************************************************
176    
   subroutine read_serre  
   
     use unit_nml_m, only: unit_nml  
     use nr_util, only: assert, pi  
   
     REAL:: clon_deg = 0. ! longitude of the center of the zoom, in degrees  
     real:: clat_deg = 0. ! latitude of the center of the zoom, in degrees  
   
     namelist /serre_nml/ clon_deg, clat_deg, grossismx, grossismy, dzoomx, &  
          dzoomy, taux, tauy  
   
     !-------------------------------------------------  
   
     ! Default values:  
     grossismx = 1.  
     grossismy = 1.  
     dzoomx = 0.2  
     dzoomy = 0.2  
     taux = 3.  
     tauy = 3.  
   
     print *, "Enter namelist 'serre_nml'."  
     read(unit=*, nml=serre_nml)  
     write(unit_nml, nml=serre_nml)  
   
     call assert(grossismx >= 1. .and. grossismy >= 1., "read_serre grossism")  
     call assert(dzoomx > 0., dzoomx < 1., dzoomy < 1., &  
          "read_serre dzoomx dzoomy")  
     clon = clon_deg / 180. * pi  
     clat = clat_deg / 180. * pi  
   
   end subroutine read_serre  
   
   !********************************************************************  
   
177    SUBROUTINE fyhyp    SUBROUTINE fyhyp
178    
179      ! From LMDZ4/libf/dyn3d/fyhyp.F, version 1.2, 2005/06/03 09:11:32      ! From LMDZ4/libf/dyn3d/fyhyp.F, version 1.2, 2005/06/03 09:11:32
180    
181      ! Author: P. Le Van, from analysis by R. Sadourny      ! Author: P. Le Van, from analysis by R. Sadourny
182    
183      ! Define rlatu, rlatv, rlatu2, yprimu2, rlatu1, yprimu1, using      ! Define rlatu, rlatv, rlatu2, yprimu2, rlatu1, yprimu1.
     ! clat, grossismy, dzoomy, tauy.  
184            
185      ! Calcule les latitudes et dérivées dans la grille du GCM pour une      ! Calcule les latitudes et dérivées dans la grille du GCM pour une
186      ! fonction f(y) à dérivée tangente hyperbolique.      ! fonction f(y) à dérivée tangente hyperbolique.
# Line 276  contains Line 189  contains
189    
190      use coefpoly_m, only: coefpoly, a0, a1, a2, a3      use coefpoly_m, only: coefpoly, a0, a1, a2, a3
191      USE dimensions, only: jjm      USE dimensions, only: jjm
192        use dynetat0_chosen_m, only: clat, grossismy, dzoomy, tauy
193      use heavyside_m, only: heavyside      use heavyside_m, only: heavyside
194    
195      ! Local:      ! Local:
# Line 583  contains Line 497  contains
497      ! From LMDZ4/libf/dyn3d/fxhyp.F, version 1.2, 2005/06/03 09:11:32      ! From LMDZ4/libf/dyn3d/fxhyp.F, version 1.2, 2005/06/03 09:11:32
498      ! Author: P. Le Van, from formulas by R. Sadourny      ! Author: P. Le Van, from formulas by R. Sadourny
499    
500      ! Compute xprimm025, rlonv, xprimv, rlonu, xprimu, xprimp025,      ! Compute xprimm025, rlonv, xprimv, rlonu, xprimu, xprimp025.
     ! using clon, grossismx, dzoomx, taux.  
501            
502      ! Calcule les longitudes et dérivées dans la grille du GCM pour      ! Calcule les longitudes et dérivées dans la grille du GCM pour
503      ! une fonction $x_f(\tilde x)$ à dérivée tangente hyperbolique.      ! une fonction $x_f(\tilde x)$ à dérivée tangente hyperbolique.
# Line 597  contains Line 510  contains
510      use nr_util, only: pi, pi_d, twopi, twopi_d, arth, assert, rad_to_deg      use nr_util, only: pi, pi_d, twopi, twopi_d, arth, assert, rad_to_deg
511    
512      USE dimensions, ONLY: iim      USE dimensions, ONLY: iim
513        use dynetat0_chosen_m, only: clon, grossismx, dzoomx, taux
514      use tanh_cautious_m, only: tanh_cautious      use tanh_cautious_m, only: tanh_cautious
515    
516      ! Local:      ! Local:
# Line 736  contains Line 650  contains
650    
651      ! Add or subtract 2 pi so that xlon is near [-pi, pi], then cshift      ! Add or subtract 2 pi so that xlon is near [-pi, pi], then cshift
652      ! so that xlon is in ascending order. Make the same cshift on      ! so that xlon is in ascending order. Make the same cshift on
653      ! xprimm. Use clon. In this module to avoid circular dependency.      ! xprimm. In this module to avoid circular dependency.
654    
655      use nr_util, only: twopi      use nr_util, only: twopi
656    
657        use dynetat0_chosen_m, only: clon
658      USE dimensions, ONLY: iim      USE dimensions, ONLY: iim
659    
660      integer, intent(in):: is2      integer, intent(in):: is2
# Line 770  contains Line 685  contains
685    
686    subroutine invert_zoom_x(beta, xf, xtild, G, xlon, xprim, xuv)    subroutine invert_zoom_x(beta, xf, xtild, G, xlon, xprim, xuv)
687    
688      ! Using clon and grossismx. In this module to avoid circular dependency.      ! In this module to avoid circular dependency.
689    
690      use coefpoly_m, only: coefpoly, a1, a2, a3      use coefpoly_m, only: coefpoly, a1, a2, a3
691        use dynetat0_chosen_m, only: clon, grossismx
692      USE dimensions, ONLY: iim      USE dimensions, ONLY: iim
693      use nr_util, only: pi_d, twopi_d      use nr_util, only: pi_d, twopi_d
694      use numer_rec_95, only: hunt, rtsafe      use numer_rec_95, only: hunt, rtsafe

Legend:
Removed from v.312  
changed lines
  Added in v.313

  ViewVC Help
Powered by ViewVC 1.1.21