- Timestamp:
- 2014-10-31T12:45:41+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/UKMO/dev_3841_sbc/NEMOGCM/NEMO/OPA_SRC/SBC/sbcflx.F90
r3625 r4827 17 17 USE sbcdcy ! surface boundary condition: diurnal cycle on qsr 18 18 USE phycst ! physical constants 19 USE fldread ! read input fields 19 USE fldread2 ! read input fields 20 USE fld_def 21 USE sbcget 20 22 USE iom ! IOM library 21 23 USE in_out_manager ! I/O manager … … 27 29 28 30 PUBLIC sbc_flx ! routine called by step.F90 29 30 INTEGER , PARAMETER :: jpfld = 5 ! maximum number of files to read31 INTEGER , PARAMETER :: jp_utau = 1 ! index of wind stress (i-component) file32 INTEGER , PARAMETER :: jp_vtau = 2 ! index of wind stress (j-component) file33 INTEGER , PARAMETER :: jp_qtot = 3 ! index of total (non solar+solar) heat file34 INTEGER , PARAMETER :: jp_qsr = 4 ! index of solar heat file35 INTEGER , PARAMETER :: jp_emp = 5 ! index of evaporation-precipation file36 TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf ! structure of input fields (file informations, fields read)37 31 38 32 !! * Substitutions … … 76 70 !! 77 71 INTEGER :: ji, jj, jf ! dummy indices 78 INTEGER :: ierror ! return error code79 72 REAL(wp) :: zfact ! temporary scalar 80 73 REAL(wp) :: zrhoa = 1.22 ! Air density kg/m3 … … 82 75 REAL(wp) :: ztx, zty, zmod, zcoef ! temporary variables 83 76 !! 84 CHARACTER(len=100) :: cn_dir ! Root directory for location of flx files 85 TYPE(FLD_N), DIMENSION(jpfld) :: slf_i ! array of namelist information structures 86 TYPE(FLD_N) :: sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp ! informations about the fields to be read 87 NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp 77 ! CHARACTER(len=100) :: cn_dir ! Root directory for location of flx files 78 ! NAMELIST/namsbc_flx/ cn_dir, sn_utau, sn_vtau, sn_qtot, sn_qsr, sn_emp 88 79 !!--------------------------------------------------------------------- 89 80 ! 90 81 IF( kt == nit000 ) THEN ! First call kt=nit000 91 ! set file information92 cn_dir = './' ! directory in which the model is executed93 ! ... default values (NB: frequency positive => hours, negative => months)94 ! ! file ! frequency ! variable ! time intep ! clim ! 'yearly' or ! weights ! rotation !95 ! ! name ! (hours) ! name ! (T/F) ! (T/F) ! 'monthly' ! filename ! pairs !96 sn_utau = FLD_N( 'utau' , 24 , 'utau' , .false. , .false. , 'yearly' , '' , '' )97 sn_vtau = FLD_N( 'vtau' , 24 , 'vtau' , .false. , .false. , 'yearly' , '' , '' )98 sn_qtot = FLD_N( 'qtot' , 24 , 'qtot' , .false. , .false. , 'yearly' , '' , '' )99 sn_qsr = FLD_N( 'qsr' , 24 , 'qsr' , .false. , .false. , 'yearly' , '' , '' )100 sn_emp = FLD_N( 'emp' , 24 , 'emp' , .false. , .false. , 'yearly' , '' , '' )101 !102 REWIND ( numnam ) ! read in namlist namflx103 READ ( numnam, namsbc_flx )104 82 ! 105 83 ! ! check: do we plan to use ln_dm2dc with non-daily forcing? 106 IF( ln_dm2dc .AND. s n_qsr%nfreqh /= 24 ) &84 IF( ln_dm2dc .AND. sf(jp_qsroce)%nfreqh /= 24 ) & 107 85 & CALL ctl_stop( 'sbc_blk_core: ln_dm2dc can be activated only with daily short-wave forcing' ) 108 !109 ! ! store namelist information in an array110 slf_i(jp_utau) = sn_utau ; slf_i(jp_vtau) = sn_vtau111 slf_i(jp_qtot) = sn_qtot ; slf_i(jp_qsr ) = sn_qsr112 slf_i(jp_emp ) = sn_emp113 !114 ALLOCATE( sf(jpfld), STAT=ierror ) ! set sf structure115 IF( ierror > 0 ) THEN116 CALL ctl_stop( 'sbc_flx: unable to allocate sf structure' ) ; RETURN117 ENDIF118 DO ji= 1, jpfld119 ALLOCATE( sf(ji)%fnow(jpi,jpj,1) )120 IF( slf_i(ji)%ln_tint ) ALLOCATE( sf(ji)%fdta(jpi,jpj,1,2) )121 END DO122 ! ! fill sf with slf_i and control print123 CALL fld_fill( sf, slf_i, cn_dir, 'sbc_flx', 'flux formulation for ocean surface boundary condition', 'namsbc_flx' )124 86 ! 125 87 sfx(:,:) = 0.0_wp ! salt flux due to freezing/melting (non-zero only if ice is present; set in limsbc(_2).F90) … … 127 89 ENDIF 128 90 129 CALL fld_read( kt, nn_fsbc, sf ) ! input fields provided at the current time-step130 131 91 IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN ! update ocean fluxes at each SBC frequency 132 92 133 IF( ln_dm2dc ) THEN ; qsr(:,:) = sbc_dcy( sf(jp_qsr )%fnow(:,:,1) ) ! modify now Qsr to include the diurnal cycle134 ELSE ; qsr(:,:) = sf(jp_qsr )%fnow(:,:,1)93 IF( ln_dm2dc ) THEN ; qsr(:,:) = sbc_dcy( sf(jp_qsroce)%fnow(:,:,1) ) ! modify now Qsr to include the diurnal cycle 94 ELSE ; qsr(:,:) = sf(jp_qsroce)%fnow(:,:,1) 135 95 ENDIF 136 96 !CDIR COLLAPSE 137 97 DO jj = 1, jpj ! set the ocean fluxes from read fields 138 98 DO ji = 1, jpi 139 utau(ji,jj) = sf(jp_ utau)%fnow(ji,jj,1)140 vtau(ji,jj) = sf(jp_ vtau)%fnow(ji,jj,1)141 qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsr )%fnow(ji,jj,1)142 emp (ji,jj) = sf(jp_ emp )%fnow(ji,jj,1)99 utau(ji,jj) = sf(jp_otx1)%fnow(ji,jj,1) 100 vtau(ji,jj) = sf(jp_oty1)%fnow(ji,jj,1) 101 qns (ji,jj) = sf(jp_qtot)%fnow(ji,jj,1) - sf(jp_qsroce)%fnow(ji,jj,1) 102 emp (ji,jj) = sf(jp_oemp )%fnow(ji,jj,1) 143 103 END DO 144 104 END DO … … 165 125 WRITE(numout,*) ' read daily momentum, heat and freshwater fluxes OK' 166 126 DO jf = 1, jpfld 167 IF( jf == jp_ utau .OR. jf == jp_vtau) zfact = 1.168 IF( jf == jp_qtot .OR. jf == jp_qsr 169 IF( jf == jp_ emp) zfact = 86400.127 IF( jf == jp_otx1 .OR. jf == jp_oty1 ) zfact = 1. 128 IF( jf == jp_qtot .OR. jf == jp_qsroce ) zfact = 0.1 129 IF( jf == jp_oemp ) zfact = 86400. 170 130 WRITE(numout,*) 171 131 WRITE(numout,*) ' day: ', ndastp , TRIM(sf(jf)%clvar), ' * ', zfact
Note: See TracChangeset
for help on using the changeset viewer.