Ignore:
Timestamp:
Nov 17, 2009, 2:00:14 PM (15 years ago)
Author:
lguez
Message:

1) Reactivated ability to read ozone (that was deactivated because of
dependency on version of IOIPSL). Added ability to read a pressure
coordinate in Pa in "regr_lat_time_climoz".

2) Added the ability to read a second ozone climatology, corresponding to
daylight ozone:

-- "read_climoz" is now an integer variable, instead of a logical
variable.

-- Added argument "read_climoz" to "phys_state_var_init",
"phys_output_open" and "regr_lat_time_climoz".

-- Created new variable "ozone_daylight" for "hist*.nc" output files.

-- Added a third dimension to variable "wo" in module
"phys_state_var_mod" and variable "POZON" in "radlwsw": index 1 for
average day-night ozone, index 2 for daylight ozone.

-- Added a fourth dimension to variables "o3_in", "o3_regr_lat" and
"o3_out" in "regr_lat_time_climoz": index 1 for average day-night
ozone, index 2 for daylight ozone.

-- In "physiq", moved call to "conf_phys" before call to
"phys_state_var_init". Thus, "conf_phys" is now inside the block "if
(first)" instead of "IF (debut)". There were definitions of "bl95_b0"
and "bl95_b1" that were useless because the variables were overwritten
by "conf_phys". Removed those definitions.

-- In "radlwsw", we pass the average day-night ozone to "LW_LMDAR4"
and the daylight ozone, if we have it, to "SW_LMDAR4" or
"SW_AEROAR4". If we do not have a specific field for daylight ozone
then "SW_LMDAR4" or "SW_AEROAR4" just get the average day-night ozone.

-- "regr_lat_time_climoz" now manages latitudes where the input ozone
field is missing at all levels (polar night).

-- Encapsulated "radlwsw" in a module.

3) Modifications to make sequential and parallel versions of
"create_etat0_limit" almost identical:

-- In "dyn3dpar/create_etat0_limit.F". No need to call
"phys_state_var_init", removed "use phys_state_var_mod" statement. No
need for "clesphys.h", removed "include" statement.

-- In "dyn3dpar/etat0_netcdf.F". Added argument "tau_ratqs" in call to
"conf_phys" (this bug was already corrected in "dyn3d"). Moved call to
"inifilr" after call to "infotrac_init" (as in "dyn3d").

4) Other peripheral modifications:

-- Added procedures "nf95_get_att" and "nf95_def_var_scalar" in
NetCDF95 interface. Overloaded "nf95_put_var" with three more
procedures: "nf95_put_var_FourByteReal", "nf95_put_var_FourByteInt",
"nf95_put_var_1D_FourByteInt".

-- Overloaded "regr1_step_av" with one more procedure:
"regr14_step_av". Overloaded "regr3_lint" with one more procedure:
"regr34_lint".

-- Corrected call to "Init_Phys_lmdz" in "dyn3d/create_etat0_limit.F":
the last argument should be an array, not a scalar.

-- Encapsulated "conf_phys" in a module.

-- Splitted module "regr_pr" into "regr_pr_av_m" and "regr_pr_int_m".

5) Tests:

This revision was compared to revision 1259, with optimization options
"debug" and "dev", parallelization options "none", "mpi", "omp" and
"mpi_omp", 1 and 2 MPI processes, 1 and 2 OpenMP threads, with the
compiler "FORTRAN90/SX Version 2.0 for SX-8". Both programs
"create_etat0_limit" and "gcm" were tested. In all cases,
parallelization does not change the results. With "read_climoz = 0" in
the ".def" files, the results of revision 1259 and of this revision
are the same.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/physiq.F

    r1259 r1263  
    1313
    1414      USE ioipsl, only: histbeg, histvert, histdef, histend, histsync,
    15      $     histwrite, ju2ymds, ymds2ju
    16 !JG     $     histwrite, ju2ymds, ymds2ju, ioget_year_len
     15     $     histwrite, ju2ymds, ymds2ju, ioget_year_len
    1716      USE comgeomphy
    1817      USE phys_cal_mod
     
    3332      USE phys_output_mod
    3433      use open_climoz_m, only: open_climoz ! ozone climatology from a file
    35       use regr_pr, only: regr_pr_av
     34      use regr_pr_av_m, only: regr_pr_av
    3635      use netcdf95, only: nf95_close
    3736      use mod_phys_lmdz_mpi_data, only: is_mpi_root
    3837      USE aero_mod
    3938      use ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
     39      use conf_phys_m, only: conf_phys
     40      use radlwsw_m, only: radlwsw
    4041
    4142      IMPLICIT none
     
    10931094      integer iunit
    10941095
    1095       logical, save::  read_climoz ! read ozone climatology from a file
    1096       integer, save:: ncid_climoz ! NetCDF file containing ozone climatology
     1096      integer, save::  read_climoz ! read ozone climatology
     1097C     Allowed values are 0, 1 and 2
     1098C     0: do not read an ozone climatology
     1099C     1: read a single ozone climatology that will be used day and night
     1100C     2: read two ozone climatologies, the average day and night
     1101C     climatology and the daylight climatology
     1102
     1103      integer, save:: ncid_climoz ! NetCDF file containing ozone climatologies
    10971104
    10981105      real, pointer, save:: press_climoz(:)
    1099 !     edges of pressure intervals for ozone climatology, in Pa, in strictly
     1106!     edges of pressure intervals for ozone climatologies, in Pa, in strictly
    11001107!     ascending order
    11011108
    1102       integer,save:: co3i = 0 ! time index in NetCDF file of current ozone field
     1109      integer, save:: co3i = 0
     1110!     time index in NetCDF file of current ozone fields
    11031111c$OMP THREADPRIVATE(co3i)
    11041112
    11051113      integer ro3i
    1106 !     required time index in NetCDF file for the ozone field, between 1 and 360
     1114!     required time index in NetCDF file for the ozone fields, between 1
     1115!     and 360
    11071116
    11081117#include "YOMCST.h"
     
    11651174      print*, 'Allocation des variables locales et sauvegardees'
    11661175      call phys_local_var_init
    1167       call phys_state_var_init
     1176c     appel a la lecture du run.def physique
     1177      call conf_phys(ok_journe, ok_mensuel,
     1178     .     ok_instan, ok_hf,
     1179     .     ok_LES,
     1180     .     solarlong0,seuil_inversion,
     1181     .     fact_cldcon, facttemps,ok_newmicro,iflag_radia,
     1182     .     iflag_cldcon,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs,
     1183     .     ok_ade, ok_aie, aerosol_couple,
     1184     .     flag_aerosol, new_aod,
     1185     .     bl95_b0, bl95_b1,
     1186     .     iflag_thermals,nsplit_thermals,tau_thermals,
     1187     .     iflag_thermals_ed,iflag_thermals_optflux,
     1188c     nv flags pour la convection et les poches froides
     1189     .     iflag_coupl,iflag_clos,iflag_wake, read_climoz)
     1190      call phys_state_var_init(read_climoz)
    11681191      print*, '================================================='
    11691192
     
    11811204        first=.false.
    11821205
    1183       endif  ! fisrt
     1206      endif  ! first
    11841207
    11851208       modname = 'physiq'
     
    12091232c
    12101233       IF (debut) THEN
    1211 C
    12121234!rv
    12131235cCRinitialisation de wght_th et lalim_conv pour la definition de la couche alimentation
     
    12201242         rain_con(:)=0.
    12211243         snow_con(:)=0.
    1222          bl95_b0=0.
    1223          bl95_b1=0.
    12241244         topswai(:)=0.
    12251245         topswad(:)=0.
     
    12471267         IF (ip_ebil_phy.ge.1) d_h_vcol_phy=0.
    12481268c
    1249 c appel a la lecture du run.def physique
    1250 c
    1251          call conf_phys(ok_journe, ok_mensuel,
    1252      .                  ok_instan, ok_hf,
    1253      .                  ok_LES,
    1254      .                  solarlong0,seuil_inversion,
    1255      .                  fact_cldcon, facttemps,ok_newmicro,iflag_radia,
    1256      .         iflag_cldcon,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs,
    1257      .                  ok_ade, ok_aie, aerosol_couple,
    1258      .                  flag_aerosol, new_aod,
    1259      .                  bl95_b0, bl95_b1,
    1260      .                  iflag_thermals,nsplit_thermals,tau_thermals,
    1261      .                  iflag_thermals_ed,iflag_thermals_optflux,
    1262 cnv flags pour la convection et les poches froides
    1263      .                   iflag_coupl,iflag_clos,iflag_wake, read_climoz)
    1264 
    12651269      print*,'iflag_coupl,iflag_clos,iflag_wake',
    12661270     .   iflag_coupl,iflag_clos,iflag_wake
     
    14531457     &                        ctetaSTD,dtime,ok_veget,
    14541458     &                        type_ocean,iflag_pbl,ok_mensuel,ok_journe,
    1455      &                        ok_hf,ok_instan,ok_LES,ok_ade,ok_aie)
     1459     &              ok_hf,ok_instan,ok_LES,ok_ade,ok_aie, read_climoz)
    14561460c$OMP END MASTER
    14571461c$OMP BARRIER
     
    15441548
    15451549C$omp single
    1546       if (read_climoz) then
     1550      if (read_climoz >= 1) then
    15471551         call open_climoz(ncid_climoz, press_climoz)
    15481552      END IF
     
    17111715c Prescrire l'ozone et calculer l'albedo sur l'ocean.
    17121716c
    1713       if (read_climoz) then
     1717      if (read_climoz >= 1) then
    17141718C        Ozone from a file
    17151719!        Update required ozone index:
    1716 !JG : ioget_year_len n'existe pas dans les versions officiels d'ioipsl
    1717 !JG         ro3i = int((days_elapsed + jh_cur - jh_1jan)
    1718 !JG     $        / ioget_year_len(year_cur) * 360.) + 1
    1719          CALL abort_gcm(modname,
    1720      $     'JG : read_climoz temporary desactivated',1)
    1721 
     1720         ro3i = int((days_elapsed + jh_cur - jh_1jan)
     1721     $        / ioget_year_len(year_cur) * 360.) + 1
    17221722         if (ro3i == 361) ro3i = 360
    17231723C        (This should never occur, except perhaps because of roundup
     
    17251725         if (ro3i /= co3i) then
    17261726C           Update ozone field:
    1727             call regr_pr_av(ncid_climoz, "tro3", julien=ro3i,
    1728      &           press_in_edg=press_climoz, paprs=paprs, v3=wo)
     1727            if (read_climoz == 1) then
     1728               call regr_pr_av(ncid_climoz, (/"tro3"/), julien=ro3i,
     1729     $              press_in_edg=press_climoz, paprs=paprs, v3=wo)
     1730            else
     1731C              read_climoz == 2
     1732               call regr_pr_av(ncid_climoz,
     1733     $              (/"tro3         ", "tro3_daylight"/),
     1734     $              julien=ro3i, press_in_edg=press_climoz, paprs=paprs,
     1735     $              v3=wo)
     1736            end if
    17291737!           Convert from mole fraction of ozone to column density of ozone in a
    17301738!           cell, in kDU:
    1731             wo = wo * rmo3 / rmd * zmasse / dobson_u / 1e3
     1739            forall (l = 1: read_climoz) wo(:, :, l) = wo(:, :, l)
     1740     $           * rmo3 / rmd * zmasse / dobson_u / 1e3
    17321741C           (By regridding ozone values for LMDZ only once every 360th of
    17331742C           year, we have already neglected the variation of pressure in one
     
    17381747      elseif (MOD(itap-1,lmt_pas) == 0) THEN
    17391748C        Once per day, update ozone from Royer:
    1740          wo = ozonecm(rlat, paprs, rjour=real(days_elapsed+1))
     1749         wo(:, :, 1) = ozonecm(rlat, paprs, rjour=real(days_elapsed+1))
    17411750      ENDIF
    17421751c
     
    28362845     $                          u,
    28372846     $                          v,
    2838      $                          wo,
     2847     $                          wo(:, :, 1),
    28392848     $                          q_seri,
    28402849     $                          zxtsol,
     
    29192928     e        (kdlon,kflev,dist, rmu0, fract, solaire,
    29202929     e        paprs, pplay,zxtsol,albsol1, albsol2, t_seri,q_seri,
    2921      e        wo,
     2930     e        wo(:, :, 1),
    29222931     e        cldfra, cldemi, cldtau,
    29232932     s        heat,heat0,cool,cool0,radsol,albpla,
     
    35293538!         close(97)
    35303539C$OMP MASTER
    3531          if (read_climoz) then
     3540         if (read_climoz >= 1) then
    35323541            if (is_mpi_root) then
    35333542               call nf95_close(ncid_climoz)
Note: See TracChangeset for help on using the changeset viewer.