- Timestamp:
- Nov 21, 2019, 4:43:45 PM (5 years ago)
- Location:
- LMDZ6/branches/Ocean_skin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Ocean_skin
-
LMDZ6/branches/Ocean_skin/libf/phylmd/readaerosolstrato.F90
r2745 r3605 7 7 USE phys_cal_mod, ONLY : mth_cur 8 8 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, & 9 grid2dto1d_glo 9 grid2dto1d_glo, grid_type, unstructured 10 10 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 11 11 USE mod_phys_lmdz_omp_data, ONLY : is_omp_root … … 15 15 USE aero_mod 16 16 USE dimphy 17 17 USE print_control_mod, ONLY: prt_level,lunout 18 #ifdef CPP_XIOS 19 USE xios 20 #endif 18 21 implicit none 19 22 … … 43 46 real, allocatable:: tauaerstrat_mois(:, :, :) 44 47 real, allocatable:: tauaerstrat_mois_glo(:, :) 48 real, allocatable:: tau_aer_strat_mpi(:, :) 45 49 46 50 ! For NetCDF: … … 58 62 data alpha_strat_wave/3.36780953,3.34667683,3.20444202,3.0293026,2.82108808/ 59 63 64 CHARACTER (len = 20) :: modname = 'readaerosolstrato' 65 CHARACTER (len = 80) :: abort_message 66 60 67 !-------------------------------------------------------- 61 68 … … 69 76 70 77 IF (nbands.NE.2) THEN 71 print *,'nbands doit etre egal a 2 dans readaerosolstrat'72 STOP78 abort_message='nbands doit etre egal a 2 dans readaerosolstrat' 79 CALL abort_physic(modname,abort_message,1) 73 80 ENDIF 74 81 … … 79 86 n_lev = size(lev) 80 87 IF (n_lev.NE.klev) THEN 81 print *,'Le nombre de niveaux n est pas egal a klev'82 STOP88 abort_message='Le nombre de niveaux n est pas egal a klev' 89 CALL abort_physic(modname,abort_message,1) 83 90 ENDIF 84 91 … … 86 93 CALL nf95_gw_var(ncid_in, varid, latitude) 87 94 n_lat = size(latitude) 88 print *, 'LAT aerosol strato=', n_lat, latitude 89 IF (n_lat.NE.nbp_lat) THEN 90 print *,'Le nombre de lat n est pas egal a nbp_lat' 91 STOP 92 ENDIF 93 95 WRITE(lunout,*) 'LAT aerosol strato=', n_lat, latitude 96 IF (grid_type/=unstructured) THEN 97 IF (n_lat.NE.nbp_lat) THEN 98 abort_message='Le nombre de lat n est pas egal a nbp_lat' 99 CALL abort_physic(modname,abort_message,1) 100 ENDIF 101 ENDIF 102 94 103 CALL nf95_inq_varid(ncid_in, "LON", varid) 95 104 CALL nf95_gw_var(ncid_in, varid, longitude) 96 105 n_lon = size(longitude) 97 print *, 'LON aerosol strato=', n_lon, longitude 98 IF (n_lon.NE.nbp_lon) THEN 99 print *,'Le nombre de lon n est pas egal a nbp_lon' 100 STOP 101 ENDIF 102 106 IF (grid_type/=unstructured) THEN 107 WRITE(lunout,*) 'LON aerosol strato=', n_lon, longitude 108 IF (n_lon.NE.nbp_lon) THEN 109 abort_message='Le nombre de lon n est pas egal a nbp_lon' 110 CALL abort_physic(modname,abort_message,1) 111 ENDIF 112 ENDIF 113 103 114 CALL nf95_inq_varid(ncid_in, "TIME", varid) 104 115 CALL nf95_gw_var(ncid_in, varid, time) 105 116 n_month = size(time) 106 print *,'TIME aerosol strato=', n_month, time117 WRITE(lunout,*) 'TIME aerosol strato=', n_month, time 107 118 IF (n_month.NE.12) THEN 108 print *,'Le nombre de month n est pas egal a 12'109 STOP119 abort_message='Le nombre de month n est pas egal a 12' 120 CALL abort_physic(modname,abort_message,1) 110 121 ENDIF 111 122 … … 117 128 CALL nf95_inq_varid(ncid_in, "TAUSTRAT", varid) 118 129 ncerr = nf90_get_var(ncid_in, varid, tauaerstrat) 119 print *,'code erreur readaerosolstrato=', ncerr, varid130 WRITE(lunout,*) 'code erreur readaerosolstrato=', ncerr, varid 120 131 121 132 CALL nf95_close(ncid_in) … … 123 134 !---select the correct month 124 135 IF (mth_cur.LT.1.OR.mth_cur.GT.12) THEN 125 print *,'probleme avec le mois dans readaerosolstrat =', mth_cur136 WRITE(lunout,*) 'probleme avec le mois dans readaerosolstrat =', mth_cur 126 137 ENDIF 127 138 tauaerstrat_mois(:,:,:) = tauaerstrat(:,:,:,mth_cur) … … 130 141 CALL grid2dTo1d_glo(tauaerstrat_mois,tauaerstrat_mois_glo) 131 142 143 ELSE 144 ALLOCATE(tauaerstrat_mois(0,0,0)) 132 145 ENDIF !--is_mpi_root and is_omp_root 133 146 134 147 !$OMP BARRIER 135 148 149 IF (grid_type==unstructured) THEN 150 #ifdef CPP_XIOS 151 IF (is_omp_master) THEN 152 CALL xios_send_field("taustrat_in",tauaerstrat_mois) 153 ALLOCATE(tau_aer_strat_mpi(klon_mpi, klev)) 154 CALL xios_recv_field("taustrat_out",tau_aer_strat_mpi) 155 ELSE 156 ALLOCATE(tau_aer_strat_mpi(0,0)) 157 ENDIF 158 CALL scatter_omp(tau_aer_strat_mpi,tau_aer_strat) 159 #endif 160 ELSE 136 161 !--scatter on all proc 137 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) 162 CALL scatter(tauaerstrat_mois_glo,tau_aer_strat) 163 ENDIF 138 164 139 165 !--keep memory of previous month
Note: See TracChangeset
for help on using the changeset viewer.