Changeset 15540 for NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/OCE/SBC/fldread.F90
- Timestamp:
- 2021-11-26T12:27:56+01:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2021/dev_r14116_HPC-10_mcastril_Mixed_Precision_implementation/src/OCE/SBC/fldread.F90
r14644 r15540 49 49 TYPE, PUBLIC :: FLD_N !: Namelist field informations 50 50 CHARACTER(len = 256) :: clname ! generic name of the NetCDF flux file 51 REAL( wp) :: freqh ! frequency of each flux file51 REAL(dp) :: freqh ! frequency of each flux file 52 52 CHARACTER(len = 34) :: clvar ! generic name of the variable in the NetCDF flux file 53 53 LOGICAL :: ln_tint ! time interpolation or not (T/F) … … 65 65 CHARACTER(len = 256) :: clrootname ! generic name of the NetCDF file 66 66 CHARACTER(len = 256) :: clname ! current name of the NetCDF file 67 REAL( wp) :: freqh ! frequency of each flux file67 REAL(dp) :: freqh ! frequency of each flux file 68 68 CHARACTER(len = 34) :: clvar ! generic name of the variable in the NetCDF flux file 69 69 LOGICAL :: ln_tint ! time interpolation or not (T/F) … … 71 71 CHARACTER(len = 8) :: clftyp ! type of data file 'daily', 'monthly' or yearly' 72 72 CHARACTER(len = 1) :: cltype ! nature of grid-points: T, U, V... 73 REAL( wp) :: zsgn ! -1. the sign change across the north fold, = 1. otherwise73 REAL(dp) :: zsgn ! -1. the sign change across the north fold, = 1. otherwise 74 74 INTEGER :: num ! iom id of the jpfld files to be read 75 75 INTEGER , DIMENSION(2,2) :: nrec ! before/after record (1: index, 2: second since Jan. 1st 00h of yr nit000) … … 77 77 INTEGER :: naa ! index of after values 78 78 INTEGER , ALLOCATABLE, DIMENSION(:) :: nrecsec ! 79 REAL( wp), POINTER, DIMENSION(:,:,: ) :: fnow ! input fields interpolated to now time step80 REAL( wp), POINTER, DIMENSION(:,:,:,:) :: fdta ! 2 consecutive record of input fields79 REAL(dp), POINTER, DIMENSION(:,:,: ) :: fnow ! input fields interpolated to now time step 80 REAL(dp), POINTER, DIMENSION(:,:,:,:) :: fdta ! 2 consecutive record of input fields 81 81 CHARACTER(len = 256) :: wgtname ! current name of the NetCDF weight file acting as a key 82 82 ! ! into the WGTLIST structure … … 115 115 INTEGER, DIMENSION(:,:,:), POINTER :: data_jpi ! array of source integers 116 116 INTEGER, DIMENSION(:,:,:), POINTER :: data_jpj ! array of source integers 117 REAL( wp), DIMENSION(:,:,:), POINTER :: data_wgt ! array of weights on model grid118 REAL( wp), DIMENSION(:,:,:), POINTER :: fly_dta ! array of values on input grid119 REAL( wp), DIMENSION(:,:,:), POINTER :: col ! temporary array for reading in columns117 REAL(dp), DIMENSION(:,:,:), POINTER :: data_wgt ! array of weights on model grid 118 REAL(dp), DIMENSION(:,:,:), POINTER :: fly_dta ! array of values on input grid 119 REAL(dp), DIMENSION(:,:,:), POINTER :: col ! temporary array for reading in columns 120 120 END TYPE WGT 121 121 … … 124 124 INTEGER :: nxt_wgt = 1 ! point to next available space in ref_wgts array 125 125 INTEGER :: nflag = 0 126 REAL( wp), PARAMETER :: undeff_lsm = -999.00_wp126 REAL(dp), PARAMETER :: undeff_lsm = -999.00_wp 127 127 128 128 !$AGRIF_END_DO_NOT_TREAT … … 130 130 !! * Substitutions 131 131 # include "do_loop_substitute.h90" 132 # include "single_precision_substitute.h90" 132 133 # include "domzgr_substitute.h90" 133 134 !!---------------------------------------------------------------------- … … 357 358 INTEGER :: idmspc ! number of spatial dimensions 358 359 LOGICAL :: lmoor ! C1D case: point data 359 REAL( wp), DIMENSION(:,:,:), POINTER :: dta_alias ! short cut360 REAL(dp), DIMENSION(:,:,:), POINTER :: dta_alias ! short cut 360 361 !!--------------------------------------------------------------------- 361 362 iaa = sdjf%naa … … 372 373 CALL wgt_list( sdjf, iw ) 373 374 CALL fld_interp( sdjf%num, sdjf%clvar, iw, ipk, dta_alias(:,:,:), sdjf%nrec(1,iaa), sdjf%lsmname ) 374 CALL lbc_lnk( 'fldread', dta_alias(:,:,:), sdjf%cltype, sdjf%zsgn, kfillmode = jpfillcopy )375 CALL lbc_lnk( 'fldread', dta_alias(:,:,:), sdjf%cltype, CASTSP(sdjf%zsgn), kfillmode = jpfillcopy ) 375 376 ELSE ! default case 376 377 ! C1D case: If product of spatial dimensions == ipk, then x,y are of … … 386 387 ELSE 387 388 CALL iom_get( sdjf%num, jpdom_global, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa), & 388 & sdjf%cltype, sdjf%zsgn, kfill = jpfillcopy )389 & sdjf%cltype, CASTSP(sdjf%zsgn), kfill = jpfillcopy ) 389 390 ENDIF 390 391 ENDIF … … 404 405 INTEGER , INTENT(in ) :: knum ! stream number 405 406 CHARACTER(LEN=*) , INTENT(in ) :: cdvar ! variable name 406 REAL( wp), DIMENSION(:,:,:), INTENT( out) :: pdta ! bdy output field on model grid407 REAL(dp), DIMENSION(:,:,:), INTENT( out) :: pdta ! bdy output field on model grid 407 408 INTEGER , INTENT(in ) :: krec ! record number to read (ie time slice) 408 409 INTEGER , DIMENSION(:) , INTENT(in ) :: kmap ! global-to-local bdy mapping indices … … 421 422 INTEGER :: indims ! number of dimensions of the variable 422 423 INTEGER, DIMENSION(4) :: idimsz ! size of variable dimensions 423 REAL( wp) :: zfv ! fillvalue424 REAL( wp), ALLOCATABLE, DIMENSION(:,:,:) :: zz_read ! work space for global boundary data425 REAL( wp), ALLOCATABLE, DIMENSION(:,:,:) :: zdta_read ! work space local data requiring vertical interpolation426 REAL( wp), ALLOCATABLE, DIMENSION(:,:,:) :: zdta_read_z ! work space local data requiring vertical interpolation427 REAL( wp), ALLOCATABLE, DIMENSION(:,:,:) :: zdta_read_dz ! work space local data requiring vertical interpolation424 REAL(dp) :: zfv ! fillvalue 425 REAL(dp), ALLOCATABLE, DIMENSION(:,:,:) :: zz_read ! work space for global boundary data 426 REAL(dp), ALLOCATABLE, DIMENSION(:,:,:) :: zdta_read ! work space local data requiring vertical interpolation 427 REAL(dp), ALLOCATABLE, DIMENSION(:,:,:) :: zdta_read_z ! work space local data requiring vertical interpolation 428 REAL(dp), ALLOCATABLE, DIMENSION(:,:,:) :: zdta_read_dz ! work space local data requiring vertical interpolation 428 429 CHARACTER(LEN=1),DIMENSION(3) :: cltype 429 430 LOGICAL :: lluld ! is the variable using the unlimited dimension … … 506 507 !! ** Purpose : inner core of fld_map 507 508 !!---------------------------------------------------------------------- 508 REAL( wp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read ! global boundary data509 REAL(dp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read ! global boundary data 509 510 INTEGER, DIMENSION(: ), INTENT(in ) :: kmap ! global-to-local bdy mapping indices 510 REAL( wp), DIMENSION(:,:,:), INTENT( out) :: pdta_bdy ! bdy output field on model grid511 REAL(dp), DIMENSION(:,:,:), INTENT( out) :: pdta_bdy ! bdy output field on model grid 511 512 !! 512 513 INTEGER, DIMENSION(3) :: idim_read, idim_bdy ! arrays dimensions … … 550 551 USE bdy_oce, ONLY: idx_bdy ! indexing for map <-> ij transformation 551 552 552 REAL( wp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read ! data read in bdy file553 REAL( wp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read_z ! depth of the data read in bdy file554 REAL( wp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read_dz ! thickness of the levels in bdy file555 REAL( wp), DIMENSION(:,:,:), INTENT( out) :: pdta ! output field on model grid (2 dimensional)556 REAL( wp) , INTENT(in ) :: pfv ! fillvalue of the data read in bdy file553 REAL(dp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read ! data read in bdy file 554 REAL(dp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read_z ! depth of the data read in bdy file 555 REAL(dp), DIMENSION(:,:,:), INTENT(in ) :: pdta_read_dz ! thickness of the levels in bdy file 556 REAL(dp), DIMENSION(:,:,:), INTENT( out) :: pdta ! output field on model grid (2 dimensional) 557 REAL(dp) , INTENT(in ) :: pfv ! fillvalue of the data read in bdy file 557 558 LOGICAL , INTENT(in ) :: ldtotvel ! true if toal ( = barotrop + barocline) velocity 558 559 INTEGER , INTENT(in ) :: kgrd ! grid type (t, u, v) … … 564 565 INTEGER :: ipkmax ! number of vertical levels in boundary data file where no mask 565 566 INTEGER :: jb, ji, jj, jk, jkb ! loop counters 566 REAL( wp) :: zcoef, zi !567 REAL( wp) :: ztrans, ztrans_new ! transports568 REAL( wp), DIMENSION(jpk) :: zdepth, zdhalf ! level and half-level depth567 REAL(dp) :: zcoef, zi ! 568 REAL(dp) :: ztrans, ztrans_new ! transports 569 REAL(dp), DIMENSION(jpk) :: zdepth, zdhalf ! level and half-level depth 569 570 !!--------------------------------------------------------------------- 570 571 … … 706 707 INTEGER :: iv ! indice of V component 707 708 CHARACTER (LEN=100) :: clcomp ! dummy weight name 708 REAL( wp), DIMENSION(jpi,jpj) :: utmp, vtmp ! temporary arrays for vector rotation709 REAL( wp), DIMENSION(:,:,:), POINTER :: dta_u, dta_v ! short cut709 REAL(dp), DIMENSION(jpi,jpj) :: utmp, vtmp ! temporary arrays for vector rotation 710 REAL(dp), DIMENSION(:,:,:), POINTER :: dta_u, dta_v ! short cut 710 711 !!--------------------------------------------------------------------- 711 712 ! … … 1106 1107 INTEGER , DIMENSION(4) :: ddims 1107 1108 INTEGER :: isrc 1108 REAL( wp), DIMENSION(jpi,jpj) :: data_tmp1109 REAL(dp), DIMENSION(jpi,jpj) :: data_tmp 1109 1110 !!---------------------------------------------------------------------- 1110 1111 ! … … 1227 1228 INTEGER, INTENT(in ) :: jpi1_lsm,jpi2_lsm,jpj1_lsm,jpj2_lsm ! temporary indices 1228 1229 INTEGER, DIMENSION(3), INTENT(in ) :: rec1_lsm,recn_lsm ! temporary arrays for start and length 1229 REAL( wp),DIMENSION (:,:,:),INTENT(inout) :: zfieldo ! input/output array for seaoverland application1230 REAL(dp),DIMENSION (:,:,:),INTENT(inout) :: zfieldo ! input/output array for seaoverland application 1230 1231 CHARACTER (len=100), INTENT(in ) :: clmaskfile ! land/sea mask file name 1231 1232 ! 1232 1233 INTEGER :: inum,jni,jnj,jnz,jc ! local indices 1233 REAL( wp),DIMENSION (:,:,:),ALLOCATABLE :: zslmec1 ! local array for land point detection1234 REAL( wp),DIMENSION (:,:), ALLOCATABLE :: zfieldn ! array of forcing field with undeff for land points1235 REAL( wp),DIMENSION (:,:), ALLOCATABLE :: zfield ! array of forcing field1234 REAL(dp),DIMENSION (:,:,:),ALLOCATABLE :: zslmec1 ! local array for land point detection 1235 REAL(dp),DIMENSION (:,:), ALLOCATABLE :: zfieldn ! array of forcing field with undeff for land points 1236 REAL(dp),DIMENSION (:,:), ALLOCATABLE :: zfield ! array of forcing field 1236 1237 !!--------------------------------------------------------------------- 1237 1238 ! … … 1290 1291 !!---------------------------------------------------------------------- 1291 1292 INTEGER , INTENT(in ) :: ileni,ilenj ! lengths 1292 REAL( wp), DIMENSION (ileni,ilenj), INTENT(in ) :: zfieldn ! array of forcing field with undeff for land points1293 REAL( wp), DIMENSION (ileni,ilenj), INTENT( out) :: zfield ! array of forcing field1294 ! 1295 REAL( wp) , DIMENSION (ileni,ilenj) :: zmat1, zmat2, zmat3, zmat4 ! local arrays1296 REAL( wp) , DIMENSION (ileni,ilenj) :: zmat5, zmat6, zmat7, zmat8 ! - -1297 REAL( wp) , DIMENSION (ileni,ilenj) :: zlsm2d ! - -1298 REAL( wp) , DIMENSION (ileni,ilenj,8) :: zlsm3d ! - -1293 REAL(dp), DIMENSION (ileni,ilenj), INTENT(in ) :: zfieldn ! array of forcing field with undeff for land points 1294 REAL(dp), DIMENSION (ileni,ilenj), INTENT( out) :: zfield ! array of forcing field 1295 ! 1296 REAL(dp) , DIMENSION (ileni,ilenj) :: zmat1, zmat2, zmat3, zmat4 ! local arrays 1297 REAL(dp) , DIMENSION (ileni,ilenj) :: zmat5, zmat6, zmat7, zmat8 ! - - 1298 REAL(dp) , DIMENSION (ileni,ilenj) :: zlsm2d ! - - 1299 REAL(dp) , DIMENSION (ileni,ilenj,8) :: zlsm3d ! - - 1299 1300 LOGICAL , DIMENSION (ileni,ilenj,8) :: ll_msknan3d ! logical mask for undeff detection 1300 1301 LOGICAL , DIMENSION (ileni,ilenj) :: ll_msknan2d ! logical mask for undeff detection … … 1330 1331 INTEGER , INTENT(in ) :: kw ! weights number 1331 1332 INTEGER , INTENT(in ) :: kk ! vertical dimension of kk 1332 REAL( wp), DIMENSION(:,:,:), INTENT(inout) :: dta ! output field on model grid1333 REAL(dp), DIMENSION(:,:,:), INTENT(inout) :: dta ! output field on model grid 1333 1334 INTEGER , INTENT(in ) :: nrec ! record number to read (ie time slice) 1334 1335 CHARACTER(LEN=*) , INTENT(in ) :: lsmfile ! land sea mask file name … … 1347 1348 INTEGER :: jpi1_lsm,jpi2_lsm,jpj1_lsm,jpj2_lsm ! temporary indices 1348 1349 INTEGER :: itmpi,itmpj,itmpz ! lengths 1349 REAL( wp),DIMENSION(:,:,:), ALLOCATABLE :: ztmp_fly_dta ! local array of values on input grid1350 REAL(dp),DIMENSION(:,:,:), ALLOCATABLE :: ztmp_fly_dta ! local array of values on input grid 1350 1351 !!---------------------------------------------------------------------- 1351 1352 ipk = SIZE(dta, 3)
Note: See TracChangeset
for help on using the changeset viewer.