New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 14219 for NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC – NEMO

Ignore:
Timestamp:
2020-12-18T18:52:57+01:00 (4 years ago)
Author:
mcastril
Message:

Add Mixed Precision support by Oriol Tintó

Location:
NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/cpl_oasis3.F90

    r14072 r14219  
    1414   !!            3.6  !  2014-11  (S. Masson) OASIS3-MCT 
    1515   !!---------------------------------------------------------------------- 
    16  
     16    
    1717   !!---------------------------------------------------------------------- 
    1818   !!   'key_oasis3'                    coupled Ocean/Atmosphere via OASIS3-MCT 
     
    6363#endif 
    6464 
    65    INTEGER                    ::   nrcv         ! total number of fields received 
    66    INTEGER                    ::   nsnd         ! total number of fields sent 
     65   INTEGER                    ::   nrcv         ! total number of fields received  
     66   INTEGER                    ::   nsnd         ! total number of fields sent  
    6767   INTEGER                    ::   ncplmodel    ! Maximum number of models to/from which NEMO is potentialy sending/receiving data 
    68    INTEGER, PUBLIC, PARAMETER ::   nmaxfld=62   ! Maximum number of coupling fields 
     68   INTEGER, PUBLIC, PARAMETER ::   nmaxfld=60   ! Maximum number of coupling fields 
    6969   INTEGER, PUBLIC, PARAMETER ::   nmaxcat=5    ! Maximum number of coupling fields 
    7070   INTEGER, PUBLIC, PARAMETER ::   nmaxcpl=5    ! Maximum number of coupling fields 
    71  
     71    
    7272   TYPE, PUBLIC ::   FLD_CPL               !: Type for coupling field information 
    7373      LOGICAL               ::   laction   ! To be coupled or not 
    74       CHARACTER(len = 8)    ::   clname    ! Name of the coupling field 
    75       CHARACTER(len = 1)    ::   clgrid    ! Grid type 
     74      CHARACTER(len = 8)    ::   clname    ! Name of the coupling field    
     75      CHARACTER(len = 1)    ::   clgrid    ! Grid type   
    7676      REAL(wp)              ::   nsgn      ! Control of the sign change 
    7777      INTEGER, DIMENSION(nmaxcat,nmaxcpl) ::   nid   ! Id of the field (no more than 9 categories and 9 extrena models) 
     
    9898      !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software) 
    9999      !! 
    100       !! ** Method  :   OASIS3 MPI communication 
     100      !! ** Method  :   OASIS3 MPI communication  
    101101      !!-------------------------------------------------------------------- 
    102102      CHARACTER(len = *), INTENT(in   ) ::   cd_modname   ! model name as set in namcouple file 
     
    132132      !!    exchange between AGCM, OGCM and COUPLER. (OASIS3 software) 
    133133      !! 
    134       !! ** Method  :   OASIS3 MPI communication 
     134      !! ** Method  :   OASIS3 MPI communication  
    135135      !!-------------------------------------------------------------------- 
    136136      INTEGER, INTENT(in) ::   krcv, ksnd     ! Number of received and sent coupling fields 
     
    180180      ! 
    181181      ! ----------------------------------------------------------------- 
    182       ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis 
     182      ! ... Define the partition, excluding halos as we don't want them to be "seen" by oasis     
    183183      ! ----------------------------------------------------------------- 
    184  
     184       
    185185      paral(1) = 2                                      ! box partitioning 
    186       paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos 
     186      paral(2) = Ni0glo * mjg0(nn_hls) + mig0(nn_hls)   ! NEMO lower left corner global offset, without halos  
    187187      paral(3) = Ni_0                                   ! local extent in i, excluding halos 
    188188      paral(4) = Nj_0                                   ! local extent in j, excluding halos 
    189189      paral(5) = Ni0glo                                 ! global extent in x, excluding halos 
    190  
     190       
    191191      IF( sn_cfctl%l_oasout ) THEN 
    192192         WRITE(numout,*) ' multiexchg: paral (1:5)', paral 
     
    195195         WRITE(numout,*) ' multiexchg: Njs0, Nje0, njmpp =', Njs0, Nje0, njmpp 
    196196      ENDIF 
    197  
     197    
    198198      CALL oasis_def_partition ( id_part, paral, nerror, Ni0glo*Nj0glo )   ! global number of points, excluding halos 
    199199      ! 
    200       ! ... Announce send variables. 
     200      ! ... Announce send variables.  
    201201      ! 
    202202      ssnd(:)%ncplmodel = kcplmodel 
     
    210210               RETURN 
    211211            ENDIF 
    212  
     212             
    213213            DO jc = 1, ssnd(ji)%nct 
    214214               DO jm = 1, kcplmodel 
     
    225225                  ENDIF 
    226226#if defined key_agrif 
    227                   IF( agrif_fixed() /= 0 ) THEN 
     227                  IF( agrif_fixed() /= 0 ) THEN  
    228228                     zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) 
    229229                  ENDIF 
     
    243243      END DO 
    244244      ! 
    245       ! ... Announce received variables. 
     245      ! ... Announce received variables.  
    246246      ! 
    247247      srcv(:)%ncplmodel = kcplmodel 
    248248      ! 
    249249      DO ji = 1, krcv 
    250          IF( srcv(ji)%laction ) THEN 
    251  
     250         IF( srcv(ji)%laction ) THEN  
     251             
    252252            IF( srcv(ji)%nct > nmaxcat ) THEN 
    253253               CALL oasis_abort ( ncomp_id, 'cpl_define', 'Number of categories of '//   & 
     
    255255               RETURN 
    256256            ENDIF 
    257  
     257             
    258258            DO jc = 1, srcv(ji)%nct 
    259259               DO jm = 1, kcplmodel 
    260  
     260                   
    261261                  IF( srcv(ji)%nct .GT. 1 ) THEN 
    262262                     WRITE(cli2,'(i2.2)') jc 
     
    270270                  ENDIF 
    271271#if defined key_agrif 
    272                   IF( agrif_fixed() /= 0 ) THEN 
     272                  IF( agrif_fixed() /= 0 ) THEN  
    273273                     zclname=TRIM(Agrif_CFixed())//'_'//TRIM(zclname) 
    274274                  ENDIF 
     
    288288         ENDIF 
    289289      END DO 
    290  
     290       
    291291      !------------------------------------------------------------------ 
    292292      ! End of definition phase 
    293293      !------------------------------------------------------------------ 
    294       ! 
     294      !      
    295295#if defined key_agrif 
    296296      IF( agrif_fixed() == Agrif_Nb_Fine_Grids() ) THEN 
     
    303303      ! 
    304304   END SUBROUTINE cpl_define 
    305  
    306  
     305    
     306    
    307307   SUBROUTINE cpl_snd( kid, kstep, pdata, kinfo ) 
    308308      !!--------------------------------------------------------------------- 
     
    324324      DO jc = 1, ssnd(kid)%nct 
    325325         DO jm = 1, ssnd(kid)%ncplmodel 
    326  
     326         
    327327            IF( ssnd(kid)%nid(jc,jm) /= -1 ) THEN   ! exclude halos from data sent to oasis 
    328328               CALL oasis_put ( ssnd(kid)%nid(jc,jm), kstep, pdata(Nis0:Nie0, Njs0:Nje0,jc), kinfo ) 
    329  
    330                IF ( sn_cfctl%l_oasout ) THEN 
     329                
     330               IF ( sn_cfctl%l_oasout ) THEN         
    331331                  IF ( kinfo == OASIS_Sent     .OR. kinfo == OASIS_ToRest .OR.   & 
    332332                     & kinfo == OASIS_SentOut  .OR. kinfo == OASIS_ToRestOut ) THEN 
     
    342342                  ENDIF 
    343343               ENDIF 
    344  
     344                
    345345            ENDIF 
    346  
     346             
    347347         ENDDO 
    348348      ENDDO 
     
    379379            IF( srcv(kid)%nid(jc,jm) /= -1 ) THEN 
    380380 
    381                CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo ) 
    382  
     381               CALL oasis_get ( srcv(kid)%nid(jc,jm), kstep, exfld, kinfo )          
     382                
    383383               llaction =  kinfo == OASIS_Recvd   .OR. kinfo == OASIS_FromRest .OR.   & 
    384384                  &        kinfo == OASIS_RecvOut .OR. kinfo == OASIS_FromRestOut 
    385  
     385                
    386386               IF ( sn_cfctl%l_oasout )   & 
    387387                  &  WRITE(numout,*) "llaction, kinfo, kstep, ivarid: " , llaction, kinfo, kstep, srcv(kid)%nid(jc,jm) 
    388  
     388                
    389389               IF( llaction ) THEN   ! data received from oasis do not include halos 
    390  
     390                   
    391391                  kinfo = OASIS_Rcv 
    392                   IF( ll_1st ) THEN 
     392                  IF( ll_1st ) THEN  
    393393                     pdata(Nis0:Nie0,Njs0:Nje0,jc) =   exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm) 
    394394                     ll_1st = .FALSE. 
     
    397397                        &                                + exfld(:,:) * pmask(Nis0:Nie0,Njs0:Nje0,jm) 
    398398                  ENDIF 
    399  
    400                   IF ( sn_cfctl%l_oasout ) THEN 
     399                   
     400                  IF ( sn_cfctl%l_oasout ) THEN         
    401401                     WRITE(numout,*) '****************' 
    402402                     WRITE(numout,*) 'oasis_get: Incoming ', srcv(kid)%clname 
     
    409409                     WRITE(numout,*) '****************' 
    410410                  ENDIF 
    411  
     411                   
    412412               ENDIF 
    413  
     413                
    414414            ENDIF 
    415  
     415             
    416416         ENDDO 
    417417 
    418418         !--- we must call lbc_lnk to fill the halos that where not received. 
    419419         IF( .NOT. ll_1st ) THEN 
    420             CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn ) 
     420            CALL lbc_lnk( 'cpl_oasis3', pdata(:,:,jc), srcv(kid)%clgrid, srcv(kid)%nsgn )    
    421421         ENDIF 
    422  
     422  
    423423      ENDDO 
    424424      ! 
     
    426426 
    427427 
    428    INTEGER FUNCTION cpl_freq( cdfieldname ) 
     428   INTEGER FUNCTION cpl_freq( cdfieldname )   
    429429      !!--------------------------------------------------------------------- 
    430430      !!              ***  ROUTINE cpl_freq  *** 
     
    491491      DEALLOCATE( exfld ) 
    492492      IF(nstop == 0) THEN 
    493          CALL oasis_terminate( nerror ) 
     493         CALL oasis_terminate( nerror )          
    494494      ELSE 
    495495         CALL oasis_abort( ncomp_id, "cpl_finalize", "NEMO ABORT STOP" ) 
    496       ENDIF 
     496      ENDIF        
    497497      ! 
    498498   END SUBROUTINE cpl_finalize 
     
    544544      WRITE(numout,*) 'oasis_enddef: Error you sould not be there...' 
    545545   END SUBROUTINE oasis_enddef 
    546  
     546   
    547547   SUBROUTINE oasis_put(k1,k2,p1,k3) 
    548548      REAL(wp), DIMENSION(:,:), INTENT(in   ) ::  p1 
     
    574574      WRITE(numout,*) 'oasis_terminate: Error you sould not be there...' 
    575575   END SUBROUTINE oasis_terminate 
    576  
     576    
    577577#endif 
    578578 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/fldread.F90

    r13546 r14219  
    383383         IF( lk_c1d .AND. lmoor ) THEN 
    384384            CALL iom_get( sdjf%num, jpdom_unknown, sdjf%clvar, dta_alias(2,2,:), sdjf%nrec(1,iaa) )   ! jpdom_unknown -> no lbc_lnk 
    385             CALL lbc_lnk( 'fldread', dta_alias(:,:,:), 'T', 1., kfillmode = jpfillcopy ) 
     385            CALL lbc_lnk( 'fldread', dta_alias(:,:,:), 'T', 1._wp, kfillmode = jpfillcopy ) 
    386386         ELSE 
    387387            CALL iom_get( sdjf%num,  jpdom_global, sdjf%clvar, dta_alias(:,:,:), sdjf%nrec(1,iaa),   & 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/geo2ocean.F90

    r13295 r14219  
    4444   !! * Substitutions 
    4545#  include "do_loop_substitute.h90" 
     46#  include "single_precision_substitute.h90" 
    4647   !!---------------------------------------------------------------------- 
    4748   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    7374         IF(lwp) WRITE(numout,*) ' ~~~~~~~~    ' 
    7475         ! 
    75          CALL angle( glamt, gphit, glamu, gphiu, glamv, gphiv, glamf, gphif )       ! initialization of the transformation 
     76         CALL angle( CASTWP(glamt), CASTWP(gphit), glamu, gphiu, glamv, gphiv, CASTWP(glamf), CASTWP(gphif) )       ! initialization of the transformation 
    7677         lmust_init = .FALSE. 
    7778      ENDIF 
     
    449450         IF(lwp) WRITE(numout,*) ' obs_rot : geographic <--> stretched' 
    450451         IF(lwp) WRITE(numout,*) ' ~~~~~~~   coordinate transformation' 
    451          CALL angle( glamt, gphit, glamu, gphiu, glamv, gphiv, glamf, gphif )       ! initialization of the transformation 
     452         CALL angle( CASTWP(glamt), CASTWP(gphit), glamu, gphiu, glamv, gphiv, CASTWP(glamf), CASTWP(gphif) )       ! initialization of the transformation 
    452453         lmust_init = .FALSE. 
    453454      ENDIF 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbc_phy.F90

    r14110 r14219  
    770770      ztaa = pTa ! first guess... 
    771771      DO jq = 1, 4 
    772          zgamma = gamma_moist( 0.5*(ztaa+pTs) , pqa )  !#LB: why not "0.5*(pqs+pqa)" rather then "pqa" ??? 
     772         zgamma = gamma_moist( 0.5_wp*(ztaa+pTs) , pqa )  !#LB: why not "0.5*(pqs+pqa)" rather then "pqa" ??? 
    773773         ztaa = pTa - zgamma*pzu   ! Absolute temp. is slightly colder... 
    774774      END DO 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbcblk.F90

    r14072 r14219  
    830830 
    831831         IF( ln_crt_fbk ) THEN 
    832             CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1., vtau, 'V', -1., taum, 'T', -1. ) 
     832            CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1._wp, vtau, 'V', -1._wp, taum, 'T', -1._wp ) 
    833833         ELSE 
    834             CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1., vtau, 'V', -1. ) 
     834            CALL lbc_lnk_multi( 'sbcblk', utau, 'U', -1._wp, vtau, 'V', -1._wp ) 
    835835         ENDIF 
    836836 
     
    11971197      ! --- evaporation minus precipitation --- ! 
    11981198      zsnw(:,:) = 0._wp 
    1199       CALL ice_var_snwblow( (1.-at_i_b(:,:)), zsnw )  ! snow distribution over ice after wind blowing 
     1199      CALL ice_var_snwblow( 1._wp-at_i_b(:,:), zsnw )  ! snow distribution over ice after wind blowing 
    12001200      emp_oce(:,:) = ( 1._wp - at_i_b(:,:) ) * zevap(:,:) - ( tprecip(:,:) - sprecip(:,:) ) - sprecip(:,:) * (1._wp - zsnw ) 
    12011201      emp_ice(:,:) = SUM( a_i_b(:,:,:) * evap_ice(:,:,:), dim=3 ) - sprecip(:,:) * zsnw 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbccpl.F90

    r14100 r14219  
    226226#  include "do_loop_substitute.h90" 
    227227#  include "domzgr_substitute.h90" 
     228#  include "single_precision_substitute.h90" 
    228229   !!---------------------------------------------------------------------- 
    229230   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    16661667               p_tauj(ji,jj) = zztmp2 * ( frcv(jpr_ity1)%z3(ji  ,jj+1,1) + frcv(jpr_ity1)%z3(ji,jj,1) ) 
    16671668            END_2D 
    1668             CALL lbc_lnk_multi( 'sbccpl', p_taui, 'U',  -1., p_tauj, 'V',  -1. ) 
     1669            CALL lbc_lnk_multi( 'sbccpl', p_taui, 'U',  -1._wp, p_tauj, 'V',  -1._wp ) 
    16691670         END SELECT 
    16701671 
     
    22782279            ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm)   ! send temperature as it is (potential or conservative) -> use of l_useCT on the received part 
    22792280         ELSE 
    2280             ! we must send the surface potential temperature 
    2281             IF( l_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( ts(:,:,1,jp_tem,Kmm), ts(:,:,1,jp_sal,Kmm) ) 
     2281            ! we must send the surface potential temperature  
     2282            IF( l_useCT )  THEN    ;   ztmp1(:,:) = eos_pt_from_ct( CASTWP(ts(:,:,1,jp_tem,Kmm)),CASTWP(ts(:,:,1,jp_sal,Kmm)) ) 
    22822283            ELSE                   ;   ztmp1(:,:) = ts(:,:,1,jp_tem,Kmm) 
    22832284            ENDIF 
     
    27132714      !                                                        ! SSS 
    27142715      IF( ssnd(jps_soce  )%laction )  THEN 
    2715          CALL cpl_snd( jps_soce  , isec, RESHAPE ( ts(:,:,1,jp_sal,Kmm), (/jpi,jpj,1/) ), info ) 
     2716         CALL cpl_snd( jps_soce  , isec, RESHAPE ( CASTWP(ts(:,:,1,jp_sal,Kmm)), (/jpi,jpj,1/) ), info ) 
    27162717      ENDIF 
    27172718      !                                                        ! first T level thickness 
    27182719      IF( ssnd(jps_e3t1st )%laction )  THEN 
    2719          CALL cpl_snd( jps_e3t1st, isec, RESHAPE ( e3t(:,:,1,Kmm)   , (/jpi,jpj,1/) ), info ) 
     2720         CALL cpl_snd( jps_e3t1st, isec, RESHAPE ( CASTWP(e3t(:,:,1,Kmm))   , (/jpi,jpj,1/) ), info ) 
    27202721      ENDIF 
    27212722      !                                                        ! Qsr fraction 
     
    27402741      !                                                      ! ------------------------- ! 
    27412742      ! needed by Met Office 
    2742       CALL eos_fzp(ts(:,:,1,jp_sal,Kmm), sstfrz) 
     2743      CALL eos_fzp(CASTWP(ts(:,:,1,jp_sal,Kmm)), sstfrz) 
    27432744      ztmp1(:,:) = sstfrz(:,:) + rt0 
    27442745      IF( ssnd(jps_sstfrz)%laction )  CALL cpl_snd( jps_sstfrz, isec, RESHAPE ( ztmp1, (/jpi,jpj,1/) ), info) 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbcflx.F90

    r14072 r14219  
    3535   INTEGER , PARAMETER ::   jp_emp  = 5   ! index of evaporation-precipation file 
    3636 !!INTEGER , PARAMETER ::   jp_sfx  = 6   ! index of salt flux flux 
    37    INTEGER , PARAMETER ::   jpfld   = 5 !! 6 ! maximum number of files to read 
     37   INTEGER , PARAMETER ::   jpfld   = 5 !! 6 ! maximum number of files to read  
    3838   TYPE(FLD), ALLOCATABLE, DIMENSION(:) ::   sf    ! structure of input fields (file informations, fields read) 
    3939 
     
    5050      !!--------------------------------------------------------------------- 
    5151      !!                    ***  ROUTINE sbc_flx  *** 
    52       !! 
     52      !!                    
    5353      !! ** Purpose :   provide at each time step the surface ocean fluxes 
    54       !!                (momentum, heat, freshwater and runoff) 
     54      !!                (momentum, heat, freshwater and runoff)  
    5555      !! 
    5656      !! ** Method  : - READ each fluxes in NetCDF files: 
     
    9191      !!--------------------------------------------------------------------- 
    9292      ! 
    93       IF( kt == nit000 ) THEN                ! First call kt=nit000 
     93      IF( kt == nit000 ) THEN                ! First call kt=nit000   
    9494         ! set file information 
    9595         READ  ( numnam_ref, namsbc_flx, IOSTAT = ios, ERR = 901) 
     
    9898         READ  ( numnam_cfg, namsbc_flx, IOSTAT = ios, ERR = 902 ) 
    9999902      IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc_flx in configuration namelist' ) 
    100          IF(lwm) WRITE ( numond, namsbc_flx ) 
     100         IF(lwm) WRITE ( numond, namsbc_flx )  
    101101         ! 
    102102         !                                         ! check: do we plan to use ln_dm2dc with non-daily forcing? 
    103103         IF( ln_dm2dc .AND. sn_qsr%freqh /= 24. )   & 
    104             &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' ) 
     104            &   CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' )  
    105105         ! 
    106106         !                                         ! store namelist information in an array 
    107107         slf_i(jp_utau) = sn_utau   ;   slf_i(jp_vtau) = sn_vtau 
    108          slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr 
     108         slf_i(jp_qtot) = sn_qtot   ;   slf_i(jp_qsr ) = sn_qsr  
    109109         slf_i(jp_emp ) = sn_emp !! ;   slf_i(jp_sfx ) = sn_sfx 
    110110         ! 
    111111         ALLOCATE( sf(jpfld), STAT=ierror )        ! set sf structure 
    112          IF( ierror > 0 ) THEN 
    113             CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN 
     112         IF( ierror > 0 ) THEN    
     113            CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' )   ;   RETURN   
    114114         ENDIF 
    115115         DO ji= 1, jpfld 
     
    123123 
    124124      CALL fld_read( kt, nn_fsbc, sf )                            ! input fields provided at the current time-step 
    125  
     125      
    126126      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN                        ! update ocean fluxes at each SBC frequency 
    127127 
    128128         IF( ln_dm2dc ) THEN   ! modify now Qsr to include the diurnal cycle 
    129             qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(:,:,1) 
     129            qsr(:,:) = sbc_dcy( sf(jp_qsr)%fnow(:,:,1) ) * tmask(ji,jj,1) 
    130130         ELSE 
    131131            DO_2D( 0, 0, 0, 0 ) 
     
    138138            qns (ji,jj) = ( sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr)%fnow(ji,jj,1) ) * tmask(ji,jj,1) 
    139139            emp (ji,jj) =   sf(jp_emp )%fnow(ji,jj,1)                              * tmask(ji,jj,1) 
    140             !!sfx (ji,jj) = sf(jp_sfx )%fnow(ji,jj,1)                              * tmask(ji,jj,1) 
     140            !!sfx (ji,jj) = sf(jp_sfx )%fnow(ji,jj,1)                              * tmask(ji,jj,1)  
    141141         END_2D 
    142142         !                                                        ! add to qns the heat due to e-p 
     
    144144         !!qns(:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp        ! mass flux is at SST 
    145145         ! 
    146          ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x) 
    147          CALL lbc_lnk_multi( 'sbcflx', utau, 'U', -1._wp, vtau, 'V', -1._wp, & 
    148             &                           qns, 'T',  1._wp, emp , 'T',  1._wp, qsr, 'T', 1._wp ) !! sfx, 'T', 1._wp  ) 
     146         ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x)  
     147         CALL lbc_lnk( 'sbcflx', utau, 'U', -1._wp) 
     148         CALL lbc_lnk( 'sbcflx', vtau, 'V', -1._wp) 
     149         CALL lbc_lnk( 'sbcflx', qns, 'T', 1._wp) 
     150         CALL lbc_lnk( 'sbcflx', emp, 'T', 1._wp) 
     151         CALL lbc_lnk( 'sbcflx', qsr, 'T', 1._wp) 
     152 
     153         ! 
     154         ! 
     155         ! clem: without these lbc calls, it seems that the northfold is not ok (true in 3.6, not sure in 4.x)  
     156        !CALL lbc_lnk_multi( 'sbcflx', utau, 'U', -1._wp, vtau, 'V', -1._wp, & 
     157        !   &                           qns, 'T',  1._wp, emp , 'T',  1._wp, qsr, 'T', 1._wp ) !! sfx, 'T', 1._wp  ) 
    149158         ! 
    150159         IF( nitend-nit000 <= 100 .AND. lwp ) THEN                ! control print (if less than 100 time-step asked) 
    151             WRITE(numout,*) 
     160            WRITE(numout,*)  
    152161            WRITE(numout,*) '        read daily momentum, heat and freshwater fluxes OK' 
    153162            DO jf = 1, jpfld 
     
    155164               IF( jf == jp_qtot .OR. jf == jp_qsr  )   zfact =     0.1 
    156165               IF( jf == jp_emp                     )   zfact = 86400. 
    157                WRITE(numout,*) 
     166               WRITE(numout,*)  
    158167               WRITE(numout,*) ' day: ', ndastp , TRIM(sf(jf)%clvar), ' * ', zfact 
    159168            END DO 
     
    166175      DO_2D( 0, 0, 0, 0 ) 
    167176         ztx = ( utau(ji-1,jj  ) + utau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( umask(ji-1,jj  ,1), umask(ji,jj,1) ) ) 
    168          zty = ( vtau(ji  ,jj-1) + vtau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( vmask(ji  ,jj-1,1), vmask(ji,jj,1) ) ) 
     177         zty = ( vtau(ji  ,jj-1) + vtau(ji,jj) ) * 0.5_wp * ( 2._wp - MIN( vmask(ji  ,jj-1,1), vmask(ji,jj,1) ) )  
    169178         zmod = 0.5_wp * SQRT( ztx * ztx + zty * zty ) * tmask(ji,jj,1) 
    170179         taum(ji,jj) = zmod 
     
    172181      END_2D 
    173182      ! 
    174       CALL lbc_lnk_multi( 'sbcflx', taum, 'T', 1._wp, wndm, 'T', 1._wp ) 
     183      CALL lbc_lnk( 'sbcflx', taum, 'T', 1._wp) 
     184      CALL lbc_lnk( 'sbcflx', wndm, 'T', 1._wp) 
     185!     CALL lbc_lnk_multi( 'sbcflx', taum, 'T', 1._wp, wndm, 'T', 1._wp ) 
    175186      ! 
    176187   END SUBROUTINE sbc_flx 
     
    178189   !!====================================================================== 
    179190END MODULE sbcflx 
     191 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbcfwb.F90

    r14200 r14219  
    3939                           ! previous year 
    4040   REAL(wp) ::   area      ! global mean ocean surface (interior domain) 
     41 
     42#  include "single_precision_substitute.h90" 
    4143 
    4244   !!---------------------------------------------------------------------- 
     
    117119         ! 
    118120         IF( MOD( kt-1, kn_fsbc ) == 0 ) THEN 
    119             y_fwfnow(1) = local_sum( e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) - snwice_fmass(:,:) ) ) 
     121            y_fwfnow(1) = local_sum( CASTWP(e1e2t(:,:) * ( emp(:,:) - rnf(:,:) + fwfisf_cav(:,:) + fwfisf_par(:,:) - snwice_fmass(:,:) )) ) 
    120122            CALL mpp_delay_sum( 'sbcfwb', 'fwb', y_fwfnow(:), z_fwfprv(:), kt == nitend - nn_fsbc + 1 ) 
    121123            z_fwfprv(1) = z_fwfprv(1) / area 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbcmod.F90

    r14072 r14219  
    7575   !! * Substitutions 
    7676#  include "do_loop_substitute.h90" 
     77#  include "single_precision_substitute.h90" 
    7778   !!---------------------------------------------------------------------- 
    7879   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    441442         END_2D 
    442443         ! 
    443          CALL lbc_lnk( 'sbcwave', utau, 'U', -1. ) 
    444          CALL lbc_lnk( 'sbcwave', vtau, 'V', -1. ) 
     444         CALL lbc_lnk_multi( 'sbcwave', utau, 'U', -1._wp , vtau, 'V', -1._wp ) 
    445445         ! 
    446446         taum(:,:) = taum(:,:)*tauoc_wave(:,:) 
     
    452452         utau(:,:) = utau(:,:) - tawx(:,:) + twox(:,:) 
    453453         vtau(:,:) = vtau(:,:) - tawy(:,:) + twoy(:,:) 
    454          CALL lbc_lnk( 'sbcwave', utau, 'U', -1. ) 
    455          CALL lbc_lnk( 'sbcwave', vtau, 'V', -1. ) 
     454         CALL lbc_lnk_multi( 'sbcwave', utau, 'U', -1._wp, vtau, 'V', -1._wp ) 
    456455         ! 
    457456         DO_2D( 0, 0, 0, 0) 
     
    463462         ! 
    464463      ENDIF 
    465       CALL lbc_lnk( 'sbcmod', taum(:,:), 'T', 1. ) 
     464      CALL lbc_lnk( 'sbcmod', taum(:,:), 'T', 1._wp ) 
    466465      ! 
    467466      !                                            !==  Misc. Options  ==! 
     
    586585         CALL prt_ctl(tab2d_1=qsr                 , clinfo1=' qsr      - : ', mask1=tmask ) 
    587586         CALL prt_ctl(tab3d_1=tmask               , clinfo1=' tmask    - : ', mask1=tmask, kdim=jpk ) 
    588          CALL prt_ctl(tab3d_1=ts(:,:,:,jp_tem,Kmm), clinfo1=' sst      - : ', mask1=tmask, kdim=1   ) 
    589          CALL prt_ctl(tab3d_1=ts(:,:,:,jp_sal,Kmm), clinfo1=' sss      - : ', mask1=tmask, kdim=1   ) 
     587         CALL prt_ctl(tab3d_1=CASTWP(ts(:,:,:,jp_tem,Kmm)), clinfo1=' sst      - : ', mask1=tmask, kdim=1   ) 
     588         CALL prt_ctl(tab3d_1=CASTWP(ts(:,:,:,jp_sal,Kmm)), clinfo1=' sss      - : ', mask1=tmask, kdim=1   ) 
    590589         CALL prt_ctl(tab2d_1=utau                , clinfo1=' utau     - : ', mask1=umask,                      & 
    591590            &         tab2d_2=vtau                , clinfo2=' vtau     - : ', mask2=vmask ) 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbcssm.F90

    r14072 r14219  
    3333 
    3434#  include "domzgr_substitute.h90" 
     35#  include "single_precision_substitute.h90" 
    3536   !!---------------------------------------------------------------------- 
    3637   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    241242         ssu_m(:,:) = uu(:,:,1,Kbb) 
    242243         ssv_m(:,:) = vv(:,:,1,Kbb) 
    243          IF( l_useCT )  THEN    ;   sst_m(:,:) = eos_pt_from_ct( ts(:,:,1,jp_tem,Kmm), ts(:,:,1,jp_sal,Kmm) ) 
     244         IF( l_useCT )  THEN    ;   sst_m(:,:) = eos_pt_from_ct( CASTWP(ts(:,:,1,jp_tem,Kmm)), CASTWP(ts(:,:,1,jp_sal,Kmm)) ) 
    244245         ELSE                   ;   sst_m(:,:) = ts(:,:,1,jp_tem,Kmm) 
    245246         ENDIF 
  • NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/src/OCE/SBC/sbcwave.F90

    r14072 r14219  
    7171   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   div_sd          !: barotropic stokes drift divergence 
    7272   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   ut0sd, vt0sd    !: surface Stokes drift velocities at t-point 
    73    REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   usd, vsd, wsd   !: Stokes drift velocities at u-, v- & w-points, resp.u 
     73   REAL(dp), PUBLIC, ALLOCATABLE, DIMENSION(:,:,:) ::   usd, vsd, wsd   !: Stokes drift velocities at u-, v- & w-points, resp.u 
    7474! 
    7575   REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:,:)   ::   charn           !: charnock coefficient at t-point 
Note: See TracChangeset for help on using the changeset viewer.