--- trunk/libf/dyn3d/start_init_orog_m.f90 2008/02/27 13:16:39 3 +++ trunk/libf/phylmd/Orography/start_init_orog_m.f90 2011/01/25 15:11:05 39 @@ -5,7 +5,7 @@ IMPLICIT NONE - REAL, ALLOCATABLE, SAVE:: masque(:, :) ! fraction of land (iim + 1, jjm + 1) + REAL, ALLOCATABLE, SAVE:: mask(:, :) ! fraction of land (iim + 1, jjm + 1) REAL, ALLOCATABLE, SAVE:: phis(:, :) ! surface geopotential, in m2 s-2 CONTAINS @@ -13,13 +13,14 @@ SUBROUTINE start_init_orog(relief, zstd_2d, zsig_2d, zgam_2d, zthe_2d, & zpic_2d, zval_2d) - USE ioipsl, only: flininfo, flinopen_nozoom, flinget, flinclo use conf_dat2d_m, only: conf_dat2d use comgeom, only: rlatu, rlonv use dimens_m, only: iim, jjm - use indicesol, only: epsfra - use comconst, only: pi + USE flincom, only: flininfo, flinopen_nozoom, flinclo + use flinget_m, only: flinget use grid_noro_m, only: grid_noro + use indicesol, only: epsfra + use nr_util, only: pi REAL, intent(out):: relief(:, :) ! orographie moyenne @@ -51,8 +52,6 @@ REAL, ALLOCATABLE:: lon_ini(:), lat_ini(:) REAL, ALLOCATABLE:: lon_rel(:, :), lat_rel(:, :) - CHARACTER(len=120) orogfname - !----------------------------------- print *, "Call sequence information: start_init_orog" @@ -64,16 +63,14 @@ size(zgam_2d, 2), size(zthe_2d, 2), size(zpic_2d, 2), & size(zval_2d, 2)/) /= jjm + 1)) stop "start_init_orog size 2" - orogfname = 'Relief.nc' print *, 'Reading the high resolution orography' - - CALL flininfo(orogfname, iml_rel, jml_rel, llm_tmp, ttm_tmp, fid) + CALL flininfo('Relief.nc', iml_rel, jml_rel, llm_tmp, ttm_tmp, fid) ALLOCATE(lat_rel(iml_rel, jml_rel)) ALLOCATE(lon_rel(iml_rel, jml_rel)) ALLOCATE(relief_hi(iml_rel, jml_rel)) - CALL flinopen_nozoom(orogfname, iml_rel, jml_rel, llm_tmp, & + CALL flinopen_nozoom(iml_rel, jml_rel, llm_tmp, & lon_rel, lat_rel, lev, ttm_tmp, itau, date, dt, fid) ! 'RELIEF': high resolution orography CALL flinget(fid, 'RELIEF', iml_rel, jml_rel, llm_tmp, ttm_tmp, 1, 1, & @@ -107,21 +104,21 @@ ! Allocate the data we need to put in the interpolated fields: ALLOCATE(phis(iim + 1, jjm + 1)) - ALLOCATE(masque(iim + 1, jjm + 1)) + ALLOCATE(mask(iim + 1, jjm + 1)) CALL grid_noro(lon_rad, lat_rad, relief_hi, rlonv, rlatu, phis, relief, & - zstd_2d, zsig_2d, zgam_2d, zthe_2d, zpic_2d, zval_2d, masque) + zstd_2d, zsig_2d, zgam_2d, zthe_2d, zpic_2d, zval_2d, mask) phis(iim + 1, :) = phis(1, :) phis(:, :) = phis(:, :) * 9.81 - masque(2:, 1) = masque(1, 1) ! north pole - masque(2:, jjm + 1) = masque(1, jjm + 1) ! south pole - masque(iim + 1, 2:jjm) = masque(1, 2:jjm) ! Greenwich - WHERE (masque < EPSFRA) - masque = 0. - elsewhere (1. - masque < EPSFRA) - masque = 1. + mask(2:, 1) = mask(1, 1) ! north pole + mask(2:, jjm + 1) = mask(1, jjm + 1) ! south pole + mask(iim + 1, 2:jjm) = mask(1, 2:jjm) ! Greenwich + WHERE (mask < EPSFRA) + mask = 0. + elsewhere (1. - mask < EPSFRA) + mask = 1. endwhere END SUBROUTINE start_init_orog