Hi,
I have run roms smoothly at the first time,Now,i try add a certain coefficient to kpp scheme, the coefficient was stored as a forcing file which have variable,s_rho,time,lon_rho and lat_rho. I have modified five .f program and varinfo.dat file, as follows:
mod_forces.F :
# ifdef WAVE_MIXING
real(r8), pointer :: bv(:,:,:)
real(r8), pointer :: bvG(:,:,:,:)
# endif
mod_ncparam.F:
integer :: idBV ! BV
get_data.F
# ifdef WAVE_MIXING
CALL get_3dfld (ng, iNLM, idBV, ncFRCid(idBV,ng), &
& nFfiles(ng), FRC(1,ng), update(1), &
& LBi, UBi, LBj, UBj,1,N(ng), 2, 1, &
# ifdef MASKING
& GRID(ng) % rmask(LBi,LBj), &
# endif
& FORCES(ng) % bvG(LBi,LBj,1,1))
IF (exit_flag.ne.NoError) RETURN
# endif
set_data.F
ifdef WAVE_MIXING
CALL set_3dfld_tile (ng, tile, iNLM, idBV, &
& LBi, UBi, LBj, UBj,1,N(ng), &
& FORCES(ng)%bvG, &
& FORCES(ng)%bv, &
& update)
IF (exit_flag.ne.NoError) RETURN
# endif
but when i compile build.bash,the errors are
ROMS/Bin/cpp_clean /lustre/home/shiyongfangWKJ/roms/projects/roms_shi/Build/get_data.f90
cd /lustre/home/shiyongfangWKJ/roms/projects/roms_shi/Build; /lustre/inspur/mpi/openmpi-intel/bin/mpif90 -c -heap-arrays -fp-model precise -ip -O3 get_data.f90
get_data.f90(86): error #6404: This name does not have a type, and must have an explicit type. [IDBV]
CALL get_3dfld (ng, iNLM, idBV, ncFRCid(idBV,ng), &
--------------------------------^
get_data.f90(90): error #6460: This is not a field name that is defined in the encompassing structure. [BVG]
& FORCES(ng) % bvG(LBi,LBj,1,1))
-----------------------------------^
get_data.f90(90): error #6158: The structure-name is invalid or is missing. [FORCES]
& FORCES(ng) % bvG(LBi,LBj,1,1))
----------------------^
compilation aborted for get_data.f90 (code 1)
make: *** [/lustre/home/shiyongfangWKJ/roms/projects/roms_shi/Build/get_data.o] Error 1
I am confused,could you give me some advice? Very grateful to you!
get_data.f90(86): error #6404:
Re: get_data.f90(86): error #6404:
Did it attempt to recompile mod_forces first? If the makefile dependencies are correct, it should have. See if your build.bash is trying a "make clean" first for a fresh go at it.
You have only declared the variables in mod_forces. You also need to allocate and initialize them. Copy the example of some other field there such as Uwind.
You have only declared the variables in mod_forces. You also need to allocate and initialize them. Copy the example of some other field there such as Uwind.
Re: get_data.f90(86): error #6404:
Thank your very much,following your suggestion,I have made some modify,and compile smoothly,kate wrote:Did it attempt to recompile mod_forces first? If the makefile dependencies are correct, it should have. See if your build.bash is trying a "make clean" first for a fresh go at it.
You have only declared the variables in mod_forces. You also need to allocate and initialize them. Copy the example of some other field there such as Uwind.
the lmd_vmix.F have added some code:
# ifdef WAVE_MIXING
USE mod_forces
# endif
# ifdef WAVE_MIXING
& FORCES(ng) % bv, &
# endif
& MIXING(ng) % bvf, &
& MIXING(ng) % Akt, &
& MIXING(ng) % Akv)
# ifdef LMD_SKPP
CALL lmd_skpp (ng, tile)
# endif
SUBROUTINE lmd_vmix_tile (ng, tile, &
& LBi, UBi, LBj, UBj, &
& IminS, ImaxS, JminS, JmaxS, &
& nstp, &
& Hz, &
# ifndef SPLINES
& z_r, &
# endif
& rho, u, v, &
# ifdef LMD_DDMIX
& t, alfaobeta, &
# endif
# ifdef WAVE_MIXING
& bv, &
# endif
& bvf, Akt, Akv)
# ifdef WAVE_MIXING
real(r8), intent(in) :: bv(LBi:,LBj:,:)
# endif
# ifdef WAVE_MIXING
real(r8), intent(in) :: bv(LBi:UBi,LBj:UBj,1:N(ng))
# endif
# ifdef WAVE_MIXING
IF(bv(i,j,k).lt.9999)then
AKv(i,j,k)=AKv(i,j,k)+bv(i,j,k)
AKt(i,j,k,itemp)=AKt(i,j,k,itemp)+bv(i,j,k)
ENDIF
# endif
and the log file show that bv have been read.
GET_3DFLD - wave induced vertical mixing coefficient, t = 165 00:00:00
(Rec=0006, Index=1, File: bv_rho.nc)
(Tmin= 15.0000 Tmax= 345.0000)
(Min = 0.00000000E+00 Max = 2.67805239E-01)
however, my new result seems to be no change,from the top, I have defined wave_mixing in .h file. but it do not show in log file,
Activated C-preprocessing Options:
SHIYF SHIYF
ANA_BSFLUX Analytical kinematic bottom salinity flux.
ANA_BTFLUX Analytical kinematic bottom temperature flux.
ASSUMED_SHAPE Using assumed-shape arrays.
AVERAGES Writing out time-averaged nonlinear model fields.
CURVGRID Orthogonal curvilinear grid.
DIFF_GRID Horizontal diffusion coefficient scaled by grid size.
DJ_GRADPS Parabolic Splines density Jacobian (Shchepetkin, 2002).
DOUBLE_PRECISION Double precision arithmetic.
LMD_CONVEC LMD convective mixing due to shear instability.
LMD_MIXING Large/McWilliams/Doney interior mixing.
LMD_NONLOCAL LMD convective nonlocal transport.
LMD_RIMIX LMD diffusivity due to shear instability.
LMD_SHAPIRO Shapiro filtering boundary layer depth.
LMD_SKPP KPP surface boundary layer mixing.
MASKING Land/Sea masking.
MIX_GEO_TS Mixing of tracers along geopotential surfaces.
MIX_S_UV Mixing of momentum along constant S-surfaces.
MPI MPI distributed-memory configuration.
NONLINEAR Nonlinear Model.
NONLIN_EOS Nonlinear Equation of State for seawater.
NO_WRITE_GRID Not Writing grid arrays into NetCDF ouput files.
POWER_LAW Power-law shape time-averaging barotropic filter.
PROFILE Time profiling activated .
RADIATION_2D Use tangential phase speed in radiation conditions.
RST_SINGLE Single precision fields in restart NetCDF file.
SALINITY Using salinity.
SCORRECTION Surface salinity flux correction.
SOLAR_SOURCE Solar Radiation Source Term.
SOLVE3D Solving 3D Primitive Equations.
SPLINES Conservative parabolic spline reconstruction.
TS_U3HADVECTION Third-order upstream horizontal advection of tracers.
TS_C4VADVECTION Fourth-order centered vertical advection of tracers.
TS_DIF2 Harmonic mixing of tracers.
UV_ADV Advection of momentum.
UV_COR Coriolis term.
UV_U3HADVECTION Third-order upstream horizontal advection of 3D momentum.
UV_C4VADVECTION Fourth-order centered vertical advection of momentum.
UV_LDRAG Linear bottom stress.
UV_VIS2 Harmonic mixing of momentum.
VAR_RHO_2D Variable density barotropic mode.
VISC_GRID Horizontal viscosity coefficient scaled by grid size.
how I know if my bv coefficient added to AKv and AKt,could you give some advice? thanks a lot!!
Re: get_data.f90(86): error #6404:
Did you add a check for WAVE_MIXING in checkdefs.F? You can see how it's done there.
Re: get_data.f90(86): error #6404:
Thank you very much! it is ok!kate wrote:Did you add a check for WAVE_MIXING in checkdefs.F? You can see how it's done there.