--- trunk/libf/dyn3d/limit.f90 2010/03/05 16:43:45 25 +++ trunk/dyn3d/limit.f 2018/03/20 09:35:59 265 @@ -9,68 +9,61 @@ ! Authors: L. Fairhead, Z. X. Li, P. Le Van ! This subroutine creates files containing boundary conditions. - ! It uses files with climatological data. - ! Both grids must be regular. + ! It uses files with climatological data. Both grids must be + ! regular. - use dimens_m, only: iim, jjm - use indicesol, only: epsfra, nbsrf, is_ter, is_oce, is_lic, is_sic + use conf_dat2d_m, only: conf_dat2d + use dimensions, only: iim, jjm use dimphy, only: klon, zmasq - use comgeom, only: rlonu, rlatv + use dynetat0_m, only: rlonu, rlatv use etat0_mod, only: pctsrf - use start_init_orog_m, only: mask - use conf_dat2d_m, only: conf_dat2d - use inter_barxy_m, only: inter_barxy - use numer_rec, only: spline, splint use grid_change, only: dyn_phy - - use netcdf95, only: handle_err, nf95_gw_var, NF95_CLOSE, NF95_DEF_DIM, & - nf95_enddef, NF95_CREATE, nf95_inq_dimid, nf95_inquire_dimension, & - nf95_inq_varid, NF95_OPEN - use netcdf, only: NF90_CLOBBER, nf90_def_var, NF90_FLOAT, NF90_GET_VAR, & - NF90_GLOBAL, NF90_NOWRITE, NF90_PUT_ATT, NF90_PUT_VAR, & + use indicesol, only: epsfra, is_ter, is_oce, is_lic, is_sic + use inter_barxy_m, only: inter_barxy + use netcdf95, only: NF95_CLOSE, NF95_CREATE, NF95_DEF_DIM, nf95_def_var, & + nf95_enddef, nf95_get_var, nf95_gw_var, nf95_inq_dimid, & + nf95_inq_varid, nf95_inquire_dimension, NF95_OPEN, NF95_PUT_ATT, & + NF95_PUT_VAR + use netcdf, only: NF90_CLOBBER, NF90_FLOAT, NF90_GLOBAL, NF90_NOWRITE, & NF90_UNLIMITED + use nr_util, only: assert + use numer_rec_95, only: spline, splint + use start_init_orog_m, only: mask + use unit_nml_m, only: unit_nml - ! Variables local to the procedure: + ! Local: LOGICAL:: extrap = .FALSE. - ! (extrapolation de données, comme pour les SST lorsque le fichier - ! ne contient pas uniquement des points océaniques) + ! (extrapolation de donn\'ees, comme pour les SST lorsque le fichier + ! ne contient pas uniquement des points oc\'eaniques) - REAL phy_alb(klon, 360) - REAL phy_sst(klon, 360) REAL phy_bil(klon, 360) - REAL phy_rug(klon, 360) REAL phy_ice(klon) - real pctsrf_t(klon, nbsrf, 360) ! composition of the surface - - ! Pour le champ de départ: + ! Pour le champ de d\'epart: INTEGER imdep, jmdep, lmdep REAL, ALLOCATABLE:: dlon(:), dlat(:) - REAL, pointer:: dlon_ini(:), dlat_ini(:), timeyear(:) + REAL, ALLOCATABLE:: dlon_ini(:), dlat_ini(:), timeyear(:) REAL, ALLOCATABLE:: champ(:, :) REAL, ALLOCATABLE:: work(:, :) - ! Pour le champ interpolé 3D : + ! Pour le champ interpol\'e 3D : REAL, allocatable:: champtime(:, :, :) REAL champan(iim + 1, jjm + 1, 360) ! Pour l'inteprolation verticale : REAL, allocatable:: yder(:) - INTEGER ierr - - INTEGER nid, ndim, ntim - INTEGER dims(2), debut(2) - INTEGER id_tim + INTEGER ndim, ntim + INTEGER varid_time INTEGER id_SST, id_BILS, id_RUG, id_ALB INTEGER id_FOCE, id_FSIC, id_FTER, id_FLIC INTEGER i, j, k, l - INTEGER ncid, varid, dimid + INTEGER ncid, ncid_limit, varid, dimid - REAL, parameter:: tmidmonth(12) = (/(15. + 30. * i, i = 0, 11)/) + REAL, parameter:: tmidmonth(12) = [(15. + 30. * i, i = 0, 11)] namelist /limit_nml/extrap @@ -79,12 +72,59 @@ print *, "Call sequence information: limit" print *, "Enter namelist 'limit_nml'." - read (unit=*, nml=limit_nml) - write(unit=*, nml=limit_nml) + read(unit=*, nml=limit_nml) + write(unit_nml, nml=limit_nml) + + call NF95_CREATE("limit.nc", NF90_CLOBBER, ncid_limit) + + call NF95_PUT_ATT(ncid_limit, NF90_GLOBAL, "title", & + "Fichier conditions aux limites") + call NF95_DEF_DIM(ncid_limit, "points_physiques", klon, ndim) + call NF95_DEF_DIM(ncid_limit, "time", NF90_UNLIMITED, ntim) + + call NF95_DEF_VAR(ncid_limit, "TEMPS", NF90_FLOAT, ntim, varid_time) + call NF95_PUT_ATT(ncid_limit, varid_time, "title", "Jour dans l annee") + + call NF95_DEF_VAR(ncid_limit, "FOCE", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_foce) + call NF95_PUT_ATT(ncid_limit, id_FOCE, "title", "Fraction ocean") + + call NF95_DEF_VAR(ncid_limit, "FSIC", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_FSIC) + call NF95_PUT_ATT(ncid_limit, id_FSIC, "title", "Fraction glace de mer") + + call NF95_DEF_VAR(ncid_limit, "FTER", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_FTER) + call NF95_PUT_ATT(ncid_limit, id_FTER, "title", "Fraction terre") + + call NF95_DEF_VAR(ncid_limit, "FLIC", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_FLIC) + call NF95_PUT_ATT(ncid_limit, id_FLIC, "title", "Fraction land ice") + + call NF95_DEF_VAR(ncid_limit, "SST", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_SST) + call NF95_PUT_ATT(ncid_limit, id_SST, "title", & + "Temperature superficielle de la mer") + + call NF95_DEF_VAR(ncid_limit, "BILS", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_BILS) + call NF95_PUT_ATT(ncid_limit, id_BILS, "title", & + "Reference flux de chaleur au sol") + + call NF95_DEF_VAR(ncid_limit, "ALB", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_ALB) + call NF95_PUT_ATT(ncid_limit, id_ALB, "title", "Albedo a la surface") + + call NF95_DEF_VAR(ncid_limit, "RUG", NF90_FLOAT, dimids=[ndim, ntim], & + varid=id_RUG) + call NF95_PUT_ATT(ncid_limit, id_RUG, "title", "Rugosite") - ! Process rugosity: + call NF95_ENDDEF(ncid_limit) + call NF95_PUT_VAR(ncid_limit, varid_time, [(k, k = 1, 360)]) + PRINT *, 'Processing rugosity...' + call NF95_OPEN('Rugos.nc', NF90_NOWRITE, ncid) ! Read coordinate variables: @@ -108,9 +148,7 @@ ! Read the primary variable day by day and regrid horizontally, ! result in "champtime": DO l = 1, lmdep - ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) - call handle_err("NF90_GET_VAR", ierr) - + call NF95_GET_VAR(ncid, varid, champ, start=[1, 1, l]) CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ) CALL inter_barxy(dlon, dlat(:jmdep -1), LOG(champ), rlonu(:iim), & rlatv, champtime(:, :, l)) @@ -120,13 +158,13 @@ call NF95_CLOSE(ncid) - DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini) + DEALLOCATE(dlon, dlat, champ) allocate(yder(lmdep)) ! Interpolate monthly values to daily values, at each horizontal position: DO j = 1, jjm + 1 DO i = 1, iim - yder(:) = SPLINE(timeyear, champtime(i, j, :)) + yder = SPLINE(timeyear, champtime(i, j, :)) DO k = 1, 360 champan(i, j, k) = SPLINT(timeyear, champtime(i, j, :), yder, & real(k-1)) @@ -134,11 +172,13 @@ ENDDO ENDDO - deallocate(timeyear, champtime, yder) + deallocate(champtime, yder) champan(iim + 1, :, :) = champan(1, :, :) - forall (k = 1:360) phy_rug(:, k) = pack(champan(:, :, k), dyn_phy) - ! Process sea ice: + DO k = 1, 360 + call NF95_PUT_VAR(ncid_limit, id_RUG, pack(champan(:, :, k), dyn_phy), & + start=[1, k]) + ENDDO PRINT *, 'Processing sea ice...' call NF95_OPEN('amipbc_sic_1x1.nc', NF90_NOWRITE, ncid) @@ -152,34 +192,34 @@ jmdep = size(dlat_ini) call nf95_inq_dimid(ncid, "time", dimid) - call NF95_INQuire_DIMension(ncid, dimid, len=lmdep) + call NF95_INQuire_DIMension(ncid, dimid, nclen=lmdep) print *, 'lmdep = ', lmdep - ! PM 28/02/2002 : nouvelle coordonnée temporelle, fichiers AMIP - ! pas en jours - ! Ici on suppose qu'on a 12 mois (de 30 jours). - IF (lmdep /= 12) STOP 'Unknown AMIP file: not 12 months?' + ! Coordonn\'ee temporelle fichiers AMIP pas en jours. Ici on suppose + ! qu'on a 12 mois (de 30 jours). + IF (lmdep /= 12) then + print *, 'Unknown AMIP file: not 12 months?' + STOP 1 + end IF ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) - ALLOCATE (dlon(imdep), dlat(jmdep)) + ALLOCATE(dlon(imdep), dlat(jmdep)) call NF95_INQ_VARID(ncid, 'sicbcs', varid) DO l = 1, lmdep - ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) - call handle_err("NF90_GET_VAR", ierr) - + call NF95_GET_VAR(ncid, varid, champ, start=[1, 1, l]) CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ) - CALL inter_barxy (dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, & + CALL inter_barxy(dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, & champtime(:, :, l)) ENDDO call NF95_CLOSE(ncid) - DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini) + DEALLOCATE(dlon, dlat, champ) PRINT *, 'Interpolation temporelle' allocate(yder(lmdep)) DO j = 1, jjm + 1 DO i = 1, iim - yder(:) = SPLINE(tmidmonth, champtime(i, j, :)) + yder = SPLINE(tmidmonth, champtime(i, j, :)) DO k = 1, 360 champan(i, j, k) = SPLINT(tmidmonth, champtime(i, j, :), yder, & real(k-1)) @@ -195,50 +235,52 @@ champan(iim + 1, :, :) = champan(1, :, :) DO k = 1, 360 - phy_ice(:) = pack(champan(:, :, k), dyn_phy) + phy_ice = pack(champan(:, :, k), dyn_phy) ! (utilisation de la sous-maille fractionnelle tandis que l'ancien ! codage utilisait l'indicateur du sol (0, 1, 2, 3)) ! PB en attendant de mettre fraction de terre - WHERE(phy_ice(:) < EPSFRA) phy_ice(:) = 0. + WHERE (phy_ice < EPSFRA) phy_ice = 0. - pctsrf_t(:, is_ter, k) = pctsrf(:, is_ter) - pctsrf_t(:, is_lic, k) = pctsrf(:, is_lic) - pctsrf_t(:, is_sic, k) = max(phy_ice(:) - pctsrf_t(:, is_lic, k), 0.) - ! Il y a des cas où il y a de la glace dans landiceref et + pctsrf(:, is_sic) = max(phy_ice - pctsrf(:, is_lic), 0.) + ! Il y a des cas o\`u il y a de la glace dans landiceref et ! pas dans AMIP - WHERE( 1. - zmasq(:) < EPSFRA) - pctsrf_t(:, is_sic, k) = 0. - pctsrf_t(:, is_oce, k) = 0. + WHERE (1. - zmasq < EPSFRA) + pctsrf(:, is_sic) = 0. + pctsrf(:, is_oce) = 0. elsewhere - where (pctsrf_t(:, is_sic, k) >= 1 - zmasq(:)) - pctsrf_t(:, is_sic, k) = 1. - zmasq(:) - pctsrf_t(:, is_oce, k) = 0. + where (pctsrf(:, is_sic) >= 1 - zmasq) + pctsrf(:, is_sic) = 1. - zmasq + pctsrf(:, is_oce) = 0. ELSEwhere - pctsrf_t(:, is_oce, k) = 1. - zmasq(:) - pctsrf_t(:, is_sic, k) - where (pctsrf_t(:, is_oce, k) < EPSFRA) - pctsrf_t(:, is_oce, k) = 0. - pctsrf_t(:, is_sic, k) = 1 - zmasq(:) + pctsrf(:, is_oce) = 1. - zmasq - pctsrf(:, is_sic) + where (pctsrf(:, is_oce) < EPSFRA) + pctsrf(:, is_oce) = 0. + pctsrf(:, is_sic) = 1 - zmasq end where end where end where DO i = 1, klon - if (pctsrf_t(i, is_oce, k) < 0.) then - print *, 'Problème sous maille : pctsrf_t(', i, & - ', is_oce, ', k, ') = ', pctsrf_t(i, is_oce, k) + if (pctsrf(i, is_oce) < 0.) then + print *, "k = ", k + print *, 'Bad surface fraction: pctsrf(', i, ', is_oce) = ', & + pctsrf(i, is_oce) ENDIF - IF (abs(pctsrf_t(i, is_ter, k) + pctsrf_t(i, is_lic, k) & - + pctsrf_t(i, is_oce, k) + pctsrf_t(i, is_sic, k) - 1.) & - > EPSFRA) THEN - print *, 'Problème sous surface :' - print *, "pctsrf_t(", i, ", :, ", k, ") = ", & - pctsrf_t(i, :, k) + IF (abs(sum(pctsrf(i, :)) - 1.) > EPSFRA) THEN + print *, "k = ", k + print *, 'Bad surface fraction:' + print *, "pctsrf(", i, ", :) = ", pctsrf(i, :) print *, "phy_ice(", i, ") = ", phy_ice(i) ENDIF END DO - ENDDO + call NF95_PUT_VAR(ncid_limit, id_FOCE, pctsrf(:, is_oce), start=[1, k]) + call NF95_PUT_VAR(ncid_limit, id_FSIC, pctsrf(:, is_sic), start=[1, k]) + call NF95_PUT_VAR(ncid_limit, id_FTER, pctsrf(:, is_ter), start=[1, k]) + call NF95_PUT_VAR(ncid_limit, id_FLIC, pctsrf(:, is_lic), start=[1, k]) + end DO + PRINT *, 'Traitement de la sst' call NF95_OPEN('amipbc_sst_1x1.nc', NF90_NOWRITE, ncid) @@ -251,41 +293,33 @@ jmdep = size(dlat_ini) call nf95_inq_dimid(ncid, "time", dimid) - call NF95_INQuire_DIMension(ncid, dimid, len=lmdep) + call NF95_INQuire_DIMension(ncid, dimid, nclen=lmdep) print *, 'lmdep = ', lmdep - !PM28/02/2002 : nouvelle coord temporelle fichiers AMIP pas en jours - ! Ici on suppose qu'on a 12 mois (de 30 jours). - IF (lmdep /= 12) stop 'Unknown AMIP file: not 12 months?' - - ALLOCATE( champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) - IF( extrap ) THEN - ALLOCATE ( work(imdep, jmdep) ) - ENDIF - ALLOCATE( dlon(imdep), dlat(jmdep) ) + ! Ici on suppose qu'on a 12 mois (de 30 jours). + call assert(lmdep == 12, 'limit: AMIP file does not contain 12 months') + + ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) + IF (extrap) ALLOCATE(work(imdep, jmdep)) + ALLOCATE(dlon(imdep), dlat(jmdep)) call NF95_INQ_VARID(ncid, 'tosbcs', varid) DO l = 1, lmdep - ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) - call handle_err("NF90_GET_VAR", ierr) - + call NF95_GET_VAR(ncid, varid, champ, start=[1, 1, l]) CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ) - IF ( extrap ) THEN - CALL extrapol(champ, imdep, jmdep, 999999., .TRUE., .TRUE., 2, work) - ENDIF - - CALL inter_barxy (dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, & - champtime(:, :, l) ) + IF (extrap) & + CALL extrapol(champ, imdep, jmdep, 999999., .TRUE., .TRUE., 2, work) + CALL inter_barxy(dlon, dlat(:jmdep -1), champ, rlonu(:iim), rlatv, & + champtime(:, :, l)) ENDDO call NF95_CLOSE(ncid) - - DEALLOCATE(dlon, dlat, champ, dlon_ini, dlat_ini) + DEALLOCATE(dlon, dlat, champ) allocate(yder(lmdep)) ! interpolation temporelle DO j = 1, jjm + 1 DO i = 1, iim - yder(:) = SPLINE(tmidmonth, champtime(i, j, :)) + yder = SPLINE(tmidmonth, champtime(i, j, :)) DO k = 1, 360 champan(i, j, k) = SPLINT(tmidmonth, champtime(i, j, :), yder, & real(k-1)) @@ -297,20 +331,24 @@ champan(iim + 1, :, :) = champan(1, :, :) !IM14/03/2002 : SST amipbc greater then 271.38 - PRINT *, 'SUB. limit_netcdf.F IM : SST Amipbc >= 271.38 ' + PRINT *, 'limit: SST Amipbc >= 271.38 ' + DO k = 1, 360 DO j = 1, jjm + 1 DO i = 1, iim - champan(i, j, k) = amax1(champan(i, j, k), 271.38) + champan(i, j, k) = max(champan(i, j, k), 271.38) ENDDO + champan(iim + 1, j, k) = champan(1, j, k) ENDDO ENDDO - forall (k = 1:360) phy_sst(:, k) = pack(champan(:, :, k), dyn_phy) - - ! Traitement de l'albedo + + DO k = 1, 360 + call NF95_PUT_VAR(ncid_limit, id_SST, pack(champan(:, :, k), dyn_phy), & + start=[1, k]) + end DO - PRINT *, 'Traitement de l albedo' + PRINT *, "Traitement de l'albedo..." call NF95_OPEN('Albedo.nc', NF90_NOWRITE, ncid) call nf95_inq_varid(ncid, "longitude", varid) @@ -325,108 +363,44 @@ call nf95_gw_var(ncid, varid, timeyear) lmdep = size(timeyear) - ALLOCATE ( champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) - ALLOCATE ( dlon(imdep), dlat(jmdep) ) + ALLOCATE(champ(imdep, jmdep), champtime(iim, jjm + 1, lmdep)) + ALLOCATE(dlon(imdep), dlat(jmdep)) call NF95_INQ_VARID(ncid, 'ALBEDO', varid) DO l = 1, lmdep - PRINT *, 'Lecture temporelle et int. horizontale ', l, timeyear(l) - ierr = NF90_GET_VAR(ncid, varid, champ, start=(/1, 1, l/)) - call handle_err("NF90_GET_VAR", ierr) - + PRINT *, "timeyear(", l, ") =", timeyear(l) + call NF95_GET_VAR(ncid, varid, champ, start=[1, 1, l]) CALL conf_dat2d(dlon_ini, dlat_ini, dlon, dlat, champ) CALL inter_barxy(dlon, dlat(:jmdep-1), champ, rlonu(:iim), rlatv, & - champtime(:, :, l) ) + champtime(:, :, l)) ENDDO call NF95_CLOSE(ncid) - deallocate(dlon_ini, dlat_ini) allocate(yder(lmdep)) ! interpolation temporelle DO j = 1, jjm + 1 DO i = 1, iim - yder(:) = SPLINE(timeyear, champtime(i, j, :)) + yder = SPLINE(timeyear, champtime(i, j, :)) DO k = 1, 360 champan(i, j, k) = SPLINT(timeyear, champtime(i, j, :), yder, & real(k-1)) ENDDO ENDDO ENDDO - deallocate(timeyear) champan(iim + 1, :, :) = champan(1, :, :) - forall (k = 1:360) phy_alb(:, k) = pack(champan(:, :, k), dyn_phy) DO k = 1, 360 - DO i = 1, klon - phy_bil(i, k) = 0.0 - ENDDO - ENDDO + call NF95_PUT_VAR(ncid_limit, id_ALB, pack(champan(:, :, k), dyn_phy), & + start=[1, k]) + end DO - PRINT *, 'Ecriture du fichier limit' - - call NF95_CREATE("limit.nc", NF90_CLOBBER, nid) - - ierr = NF90_PUT_ATT(nid, NF90_GLOBAL, "title", & - "Fichier conditions aux limites") - call NF95_DEF_DIM (nid, "points_physiques", klon, ndim) - call NF95_DEF_DIM (nid, "time", NF90_UNLIMITED, ntim) - - dims(1) = ndim - dims(2) = ntim - - ierr = NF90_DEF_VAR (nid, "TEMPS", NF90_FLOAT, ntim, id_tim) - ierr = NF90_PUT_ATT (nid, id_tim, "title", & - "Jour dans l annee") - ierr = NF90_DEF_VAR (nid, "FOCE", NF90_FLOAT, dims, id_FOCE) - ierr = NF90_PUT_ATT (nid, id_FOCE, "title", & - "Fraction ocean") - - ierr = NF90_DEF_VAR (nid, "FSIC", NF90_FLOAT, dims, id_FSIC) - ierr = NF90_PUT_ATT (nid, id_FSIC, "title", & - "Fraction glace de mer") - - ierr = NF90_DEF_VAR (nid, "FTER", NF90_FLOAT, dims, id_FTER) - ierr = NF90_PUT_ATT (nid, id_FTER, "title", & - "Fraction terre") - - ierr = NF90_DEF_VAR (nid, "FLIC", NF90_FLOAT, dims, id_FLIC) - ierr = NF90_PUT_ATT (nid, id_FLIC, "title", & - "Fraction land ice") - - ierr = NF90_DEF_VAR (nid, "SST", NF90_FLOAT, dims, id_SST) - ierr = NF90_PUT_ATT (nid, id_SST, "title", & - "Temperature superficielle de la mer") - ierr = NF90_DEF_VAR (nid, "BILS", NF90_FLOAT, dims, id_BILS) - ierr = NF90_PUT_ATT (nid, id_BILS, "title", & - "Reference flux de chaleur au sol") - ierr = NF90_DEF_VAR (nid, "ALB", NF90_FLOAT, dims, id_ALB) - ierr = NF90_PUT_ATT (nid, id_ALB, "title", & - "Albedo a la surface") - ierr = NF90_DEF_VAR (nid, "RUG", NF90_FLOAT, dims, id_RUG) - ierr = NF90_PUT_ATT (nid, id_RUG, "title", & - "Rugosite") - - call NF95_ENDDEF(nid) - - DO k = 1, 360 - debut(1) = 1 - debut(2) = k - - ierr = NF90_PUT_VAR(nid, id_tim, FLOAT(k), (/k/)) - ierr = NF90_PUT_VAR(nid, id_FOCE, pctsrf_t(:, is_oce, k), debut) - ierr = NF90_PUT_VAR (nid, id_FSIC, pctsrf_t(:, is_sic, k), debut) - ierr = NF90_PUT_VAR (nid, id_FTER, pctsrf_t(:, is_ter, k), debut) - ierr = NF90_PUT_VAR (nid, id_FLIC, pctsrf_t(:, is_lic, k), debut) - ierr = NF90_PUT_VAR (nid, id_SST, phy_sst(:, k), debut) - ierr = NF90_PUT_VAR (nid, id_BILS, phy_bil(:, k), debut) - ierr = NF90_PUT_VAR (nid, id_ALB, phy_alb(:, k), debut) - ierr = NF90_PUT_VAR (nid, id_RUG, phy_rug(:, k), debut) - ENDDO + phy_bil = 0. + call NF95_PUT_VAR(ncid_limit, id_BILS, phy_bil) - call NF95_CLOSE(nid) + call NF95_CLOSE(ncid_limit) END SUBROUTINE limit