Ignore:
Timestamp:
Sep 8, 2009, 11:16:12 AM (15 years ago)
Author:
lguez
Message:

Print only defined values of "timeyear" in procedure "limit_netcdf".

Processing of input variable "read_climoz" by procedure "conf_phys"
was broken in revision 1227. Fixed it back (no need for a variable
"read_climoz_omp"; "read_climoz" is OpenMP shared).

Procedure "regr_lat_time_climoz" now takes into account missing values
in the input field.

Location:
LMDZ4/branches/LMDZ4-dev/libf
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3d/limit_netcdf.F

    r1222 r1239  
    406406      ENDDO
    407407
    408       PRINT 222, timeyear
     408      PRINT 222, timeyear(:lmdep)
    409409222   FORMAT(2x,' Time year ',10f6.1)
    410410c
     
    623623         timeyear(l) = tmidmonth(l)
    624624      ENDDO
    625       PRINT 222,  timeyear
     625      PRINT 222,  timeyear(:lmdep)
    626626c
    627627      PRINT*, 'Interpolation temporelle'
     
    942942         timeyear(l) = tmidmonth(l)
    943943      ENDDO
    944       print 222,  timeyear
     944      print 222,  timeyear(:lmdep)
    945945c
    946946C interpolation temporelle
     
    11371137         timeyear(l) = timecoord(l)
    11381138      ENDDO
    1139       print 222,  timeyear
     1139      print 222,  timeyear(:lmdep)
    11401140c
    11411141C interpolation temporelle
  • LMDZ4/branches/LMDZ4-dev/libf/dyn3dpar/limit_netcdf.F

    r1222 r1239  
    406406      ENDDO
    407407
    408       PRINT 222, timeyear
     408      PRINT 222, timeyear(:lmdep)
    409409222   FORMAT(2x,' Time year ',10f6.1)
    410410c
     
    623623         timeyear(l) = tmidmonth(l)
    624624      ENDDO
    625       PRINT 222,  timeyear
     625      PRINT 222,  timeyear(:lmdep)
    626626c
    627627      PRINT*, 'Interpolation temporelle'
     
    942942         timeyear(l) = tmidmonth(l)
    943943      ENDDO
    944       print 222,  timeyear
     944      print 222,  timeyear(:lmdep)
    945945c
    946946C interpolation temporelle
     
    11371137         timeyear(l) = timecoord(l)
    11381138      ENDDO
    1139       print 222,  timeyear
     1139      print 222,  timeyear(:lmdep)
    11401140c
    11411141C interpolation temporelle
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/conf_phys.F90

    r1229 r1239  
    146146  LOGICAL,SAVE :: ok_strato_omp
    147147  LOGICAL,SAVE :: ok_hines_omp
    148   LOGICAL      :: read_climoz_omp
    149148  LOGICAL      :: carbon_cycle_tr_omp
    150149  LOGICAL      :: carbon_cycle_cpl_omp
     
    12821281  call getin('ecrit_LES', ecrit_LES_omp)
    12831282!
    1284   read_climoz_omp = .false. ! default value
    1285   call getin('read_climoz', read_climoz_omp)
     1283  read_climoz = .false. ! default value
     1284  call getin('read_climoz', read_climoz)
    12861285
    12871286  carbon_cycle_tr_omp=.FALSE.
     
    14211420    ok_LES = ok_LES_omp
    14221421    ecrit_LES = ecrit_LES_omp
    1423     read_climoz = read_climoz_omp
    14241422    carbon_cycle_tr = carbon_cycle_tr_omp
    14251423    carbon_cycle_cpl = carbon_cycle_cpl_omp
  • LMDZ4/branches/LMDZ4-dev/libf/phylmd/regr_lat_time_climoz_m.F90

    r1220 r1239  
    2121
    2222    ! The input field depends on time, pressure level and latitude.
     23
     24    ! If the input field has missing values, they must be signaled by
     25    ! the "missing_value" attribute. At each latitude and each date, the
     26    ! missing values are replaced by the lowest valid value above missing
     27    ! values.
     28
    2329    ! We assume that the input field is a step function of latitude
    2430    ! and that the input latitude coordinate gives the centers of steps.
     
    5258    ! -- time increases (even though we do not use values of the input
    5359    ! time coordinate);
     60    ! -- missing values are vertically contiguous, at the bottom of
     61    ! the vertical domain;
     62    ! -- there is no missing value at the top level of the atmosphere.
    5463
    5564    use regr1_step_av_m, only: regr1_step_av
     
    5766    use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, handle_err, &
    5867         nf95_put_var, nf95_gw_var
    59     use netcdf, only: nf90_nowrite, nf90_get_var
     68    use netcdf, only: nf90_nowrite, nf90_get_att, nf90_noerr
    6069
    6170    ! Variables local to the procedure:
     
    8998    real, pointer:: o3_in(:, :, :) ! (n_lat, n_plev, 12 or 0:13)
    9099    ! (ozone climatology from the input file)
    91     ! ("o3_in(j, l, month)" is at latitude "latitude(j)" and pressure
    92     ! level "plev(l)". "month" is between 1 and 12 or between 0 and 13)
     100    ! ("o3_in(j, k, l)" is at latitude "latitude(j)" and pressure
     101    ! level "plev(k)". "l" is between 1 and 12 or between 0 and 13)
     102
     103    real missing_value
    93104
    94105    real, allocatable:: o3_regr_lat(:, :, :) ! (jjm + 1, n_plev, 0:13)
     
    103114    ! [- pi / 2, rlatv(jjm)]
    104115    ! respectively.
    105     ! "o3_regr_lat(:, l, :)" is for pressure level "plev(l)".
     116    ! "o3_regr_lat(:, k, :)" is for pressure level "plev(k)".
    106117    ! Last dimension is month number.)
    107118
    108119    real, allocatable:: o3_out(:, :, :) ! (jjm + 1, n_plev, 360)
    109120    ! (regridded ozone climatology)
    110     ! ("o3_out(j, l, day)" is at latitude "rlatu(j)", pressure
    111     ! level "plev(l)" and date "January 1st 0h" + "tmidday(day)", in a
     121    ! ("o3_out(j, k, l)" is at latitude "rlatu(j)", pressure
     122    ! level "plev(k)" and date "January 1st 0h" + "tmidday(l)", in a
    112123    ! 360-day calendar.)
    113124
    114     integer j
    115     integer varid_in, varid_out, varid_plev, varid_time, varid ! (for NetCDF)
    116 
    117     real, parameter:: tmidmonth(0:13) = (/(-15. + 30. * j, j = 0, 13)/)
     125    integer j, k, l
     126
     127    ! For NetCDF:
     128    integer varid_in, varid_out, varid_plev, varid_time, varid, ncerr
     129
     130    real, parameter:: tmidmonth(0:13) = (/(-15. + 30. * l, l = 0, 13)/)
    118131    ! (time to middle of month, in days since January 1st 0h, in a
    119132    ! 360-day calendar)
     
    121134    ! interpolated between the December and the January value.)
    122135
    123     real, parameter:: tmidday(360) = (/(j + 0.5, j = 0, 359)/)
     136    real, parameter:: tmidday(360) = (/(l + 0.5, l = 0, 359)/)
    124137    ! (time to middle of day, in days since January 1st 0h, in a
    125138    ! 360-day calendar)
     
    175188    if (desc_plev) o3_in = o3_in(:, n_plev:1:-1, :)
    176189
     190    ncerr = nf90_get_att(ncid_in, varid_in, "missing_value", missing_value)
     191    if (ncerr == nf90_noerr) then
     192       do l = 1, size(o3_in, 3)
     193          do j = 1, n_lat
     194             ! Find missing values, starting from top of atmosphere
     195             ! and going down.
     196             ! We assume that the highest level contains no missing value.
     197             k = 2
     198             do
     199                if (o3_in(j, k, l) == missing_value .or. k == n_plev) exit
     200                k = k + 1
     201             end do
     202             ! Replace missing values with the valid value at the
     203             ! lowest level above missing values:
     204             if (o3_in(j, k, l) == missing_value) &
     205                  o3_in(j, k:n_plev, l) = o3_in(j, k-1, l)
     206          end do
     207       end do
     208    else
     209       print *, "regr_lat_time_climoz: no missing value attribute"
     210    end if
     211   
    177212    call nf95_close(ncid_in)
    178213
Note: See TracChangeset for help on using the changeset viewer.