- Timestamp:
- Nov 5, 2018, 3:24:59 PM (6 years ago)
- Location:
- LMDZ6/branches/DYNAMICO-conv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/DYNAMICO-conv
- Property svn:mergeinfo changed
/LMDZ6/trunk removed
- Property svn:mergeinfo changed
-
LMDZ6/branches/DYNAMICO-conv/libf/phylmd/readchlorophyll.F90
r3356 r3411 2 2 ! $Id$ 3 3 ! 4 !--This routine is to be tested with MPI / OMP parallelism5 !--OB 26/03/20186 4 7 SUBROUTINEreadchlorophyll(debut)5 subroutine readchlorophyll(debut) 8 6 9 USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, nf95_inq_varid, nf95_open 10 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite 11 USE phys_cal_mod, ONLY: mth_cur 12 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid2dto1d_glo 13 USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root 14 USE mod_phys_lmdz_omp_data, ONLY: is_omp_root 7 use netcdf95, only: nf95_close, nf95_gw_var, nf95_inq_dimid, & 8 nf95_inq_varid, nf95_open 9 use netcdf, only: nf90_get_var, nf90_noerr, nf90_nowrite 10 11 USE phys_cal_mod, ONLY : mth_cur 12 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, & 13 grid2dto1d_glo 14 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 15 15 USE mod_phys_lmdz_para, ONLY: scatter 16 16 USE phys_state_var_mod, ONLY: chl_con 17 17 18 IMPLICIT NONE18 implicit none 19 19 20 INCLUDE"YOMCST.h"20 include "YOMCST.h" 21 21 22 22 ! Variable input 23 LOGICALdebut23 logical debut 24 24 25 25 ! Variables locales 26 INTEGERn_lat ! number of latitudes in the input data27 INTEGERn_lon ! number of longitudes in the input data28 INTEGERn_lev ! number of levels in the input data29 INTEGERn_month ! number of months in the input data30 REAL, POINTER:: latitude(:)31 REAL, POINTER:: longitude(:)32 REAL, POINTER:: time(:)33 INTEGERi, k34 INTEGER, SAVE:: mth_pre26 integer n_lat ! number of latitudes in the input data 27 integer n_lon ! number of longitudes in the input data 28 integer n_lev ! number of levels in the input data 29 integer n_month ! number of months in the input data 30 real, pointer:: latitude(:) 31 real, pointer:: longitude(:) 32 real, pointer:: time(:) 33 integer i, k 34 integer, save :: mth_pre 35 35 !$OMP THREADPRIVATE(mth_pre) 36 36 37 37 ! Champs reconstitues 38 REAL, ALLOCATABLE:: chlorocon(:, :, :)39 REAL, ALLOCATABLE:: chlorocon_mois(:, :)40 REAL, ALLOCATABLE:: chlorocon_mois_glo(:)38 real, allocatable:: chlorocon(:, :, :) 39 real, allocatable:: chlorocon_mois(:, :) 40 real, allocatable:: chlorocon_mois_glo(:) 41 41 42 42 ! For NetCDF: 43 INTEGER ncid_in ! IDs for input files 44 INTEGER varid, ncerr 43 integer ncid_in ! IDs for input files 44 integer varid, ncerr 45 45 46 46 47 !-------------------------------------------------------- 48 47 49 48 50 !--only read file if beginning of run or start of new month 49 51 IF (debut.OR.mth_cur.NE.mth_pre) THEN 50 52 51 IF (is_mpi_root.AND.is_omp_root) THEN 53 IF (is_mpi_root) THEN 54 52 55 53 56 CALL nf95_open("chlorophyll.nc", nf90_nowrite, ncid_in) … … 61 64 STOP 62 65 ENDIF 66 63 67 64 68 CALL nf95_inq_varid(ncid_in, "lat", varid) … … 100 104 CALL grid2dTo1d_glo(chlorocon_mois,chlorocon_mois_glo) 101 105 102 print *,"chrolophyll current month",mth_cur 103 DO i=1,klon_glo 106 107 print*,"chrolophyll current month",mth_cur 108 do i=1,klon_glo 104 109 ! if(isnan(chlorocon_mois_glo(i)))then ! isnan() is not in the Fortran standard... 105 110 ! Another way to check for NaN: 106 IF (chlorocon_mois_glo(i).NE.chlorocon_mois_glo(i)) chlorocon_mois_glo(i)=0. 107 ENDDO 111 if(chlorocon_mois_glo(i).ne.chlorocon_mois_glo(i)) then 112 chlorocon_mois_glo(i)=0. 113 endif 114 !print*,"high chl con",i,chlorocon_mois_glo(i) 115 enddo 108 116 109 117 ! DEALLOCATE(chlorocon) … … 111 119 ! DEALLOCATE(chlorocon_mois_glo) 112 120 113 ENDIF !--is_mpi_root and is_omp_root121 ENDIF !--is_mpi_root 114 122 115 123 !--scatter on all proc … … 121 129 ENDIF !--debut ou nouveau mois 122 130 123 END SUBROUTINEreadchlorophyll131 end subroutine readchlorophyll
Note: See TracChangeset
for help on using the changeset viewer.