some problems about bulk_fluxes

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

some problems about bulk_fluxes

#1 Unread post by zzyfathead »

Hi all,

I have some problems about bulk_fluxes.

I used bulk_fluxes before in my old case and I input Uwind, Vwind, Pair, Tair..... at that time.

But now I try to run a new case. I just have sustrs and svstrs data.

I wonder that if I just input sustrs and svstrs, must I set ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX?

And must I still turn on bulk_fluxes in my head file?

(In another word, I wonder that if all of the surface fluxes are necessary in ROMS, I just want to input stress and don't consider S/T influence)

Thanks!!

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#2 Unread post by kate »

I wonder that if I just input sustrs and svstrs, must I set ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX?
Yes, if you provide the stresses, you need to provide the tracer fluxes too, and turn off BULK_FLUXES.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#3 Unread post by zzyfathead »

kate wrote: Fri Jan 03, 2020 5:37 pm
I wonder that if I just input sustrs and svstrs, must I set ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX?
Yes, if you provide the stresses, you need to provide the tracer fluxes too, and turn off BULK_FLUXES.
Kate,

Thanks. So the step is :

1. Undef BULK_FLUXES in .h file. and define ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX (totally 4 ?) in .h file (I wonder how ana function set these 4 variables, just as zero automatically?).

2. Set NFFFILE=1 and input test_stress .nc file

:D

Thanks again, happy new year!

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#4 Unread post by zzyfathead »

zzyfathead wrote: Sat Jan 04, 2020 7:05 am
kate wrote: Fri Jan 03, 2020 5:37 pm
I wonder that if I just input sustrs and svstrs, must I set ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX?
Yes, if you provide the stresses, you need to provide the tracer fluxes too, and turn off BULK_FLUXES.
Kate,

Thanks. So the step is :

1. Undef BULK_FLUXES in .h file, and define ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX (totally 4 ?) in .h file (I wonder how ana function set these 4 variables, just as zero automatically?).

2. Set NFFFILE=1 and input test_stress .nc file?

:D

Thanks again, happy new year!

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#5 Unread post by kate »

1. Undef BULK_FLUXES in .h file. and define ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX (totally 4 ?) in .h file (I wonder how ana function set these 4 variables, just as zero automatically?).

2. Set NFFFILE=1 and input test_stress .nc file
Yes, exactly. The way to tell what the default stresses will be is to look at the ana_stflux.h files that come with ROMS. Or you can wait until the compile step happens and look at what ends up in analytical.f90. I do believe all four default to zero, while some of the other ana_xxx routines default to something that will fail to compile.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#6 Unread post by zzyfathead »

kate wrote: Sat Jan 04, 2020 7:38 am
1. Undef BULK_FLUXES in .h file. and define ANA_STFLUX, ANA_SSFLUX, ANA_BSFLUX and ANA_BTFLUX (totally 4 ?) in .h file (I wonder how ana function set these 4 variables, just as zero automatically?).

2. Set NFFFILE=1 and input test_stress .nc file
Yes, exactly. The way to tell what the default stresses will be is to look at the ana_stflux.h files that come with ROMS. Or you can wait until the compile step happens and look at what ends up in analytical.f90. I do believe all four default to zero, while some of the other ana_xxx routines default to something that will fail to compile.
Thank you for the guidance, now I have clear understanding and I'll have a try.
Last edited by zzyfathead on Sat Jan 04, 2020 10:34 am, edited 1 time in total.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#7 Unread post by zzyfathead »

Hi all,

I have some new puzzles with the time units of sustr and svstr.

I set dt=0.1s and Ntime=4000 in ocean.in file, so the whole run time is 400s.

Firstly, I set unit of sustr and svstr as 's' in stress.nc file and input a set of sustr and svstr(dt is 0.1s). For example sustr 0.1s 0.2s 0.3s..........

But I don't know why ROMS just read 0:00:00 and 02:24:00 (begining and ending )sustr and svstr at the initial run time. It should read stress every 0.1s...

And the calculation result shows sustr and svstr did not read stress.nc file time by time. (which means ROMS just read the two moments of sustr and svstr).

Here is the result, pay attention to the bold part :

Thanks

Metrics information for Grid 01:
===============================

Minimum X-grid spacing, DXmin = 1.00256452E-01 km
Maximum X-grid spacing, DXmax = 1.00262565E-01 km
Minimum Y-grid spacing, DYmin = 9.95304436E-02 km
Maximum Y-grid spacing, DYmax = 9.95306247E-02 km
Minimum Z-grid spacing, DZmin = 6.67249747E-02 m
Maximum Z-grid spacing, DZmax = 1.48550347E+02 m

Minimum barotropic Courant Number = 3.13541117E-04
Maximum barotropic Courant Number = 6.36221117E-03
Maximum Coriolis Courant Number = 2.24399702E-07


NLM: GET_STATE - Read state initial conditions, t = 0 00:00:00
(Grid 01, File: init.nc, Rec=0001, Index=1)
- free-surface
(Min = 0.00000000E+00 Max = 0.00000000E+00)
- vertically integrated u-momentum component
(Min = 0.00000000E+00 Max = 0.00000000E+00)
- vertically integrated v-momentum component
(Min = 0.00000000E+00 Max = 0.00000000E+00)
- u-momentum component
(Min = 0.00000000E+00 Max = 0.00000000E+00)
- v-momentum component
(Min = 0.00000000E+00 Max = 0.00000000E+00)
- potential temperature
(Min = 1.00000000E+01 Max = 1.00000000E+01)
- salinity
(Min = 3.50000000E+01 Max = 3.50000000E+01)
GET_2DFLD - surface u-momentum stress, t = 0 00:00:00
(Rec=0000001, Index=1, File: stress.nc)
(Tmin= 0.0000 Tmax= 3001.0000)
(Min = 0.00000000E+00 Max = 0.00000000E+00)
GET_2DFLD - surface v-momentum stress, t = 0 00:00:00
(Rec=0000001, Index=1, File: stress.nc)
(Tmin= 0.0000 Tmax= 3001.0000)
(Min = 0.00000000E+00 Max = 0.00000000E+00)

Basin information for Grid 01:

Maximum grid stiffness ratios: rx0 = 2.000000E-01 (Beckmann and Haidvogel)
rx1 = 5.521489E+00 (Haney)

Initial basin volumes: TotVolume = 5.9981723531E+10 m3
MinVolume = 6.6582455595E+02 m3
MaxVolume = 1.4784641003E+06 m3
Max/Min = 2.2205010120E+03

NL ROMS/TOMS: started time-stepping: (Grid: 01 TimeSteps: 00000001 - 00029000)

GET_2DFLD - surface u-momentum stress, t = 0 02:24:00
(Rec=0000002, Index=2, File:stress.nc)
(Tmin= 0.0000 Tmax= 3001.0000)
(Min = 0.00000000E+00 Max = 0.00000000E+00)
GET_2DFLD - surface v-momentum stress, t = 0 02:24:00
(Rec=0000002, Index=2, File: stress.nc)
(Tmin= 0.0000 Tmax= 3001.0000)
(Min = 0.00000000E+00 Max = 0.00000000E+00)


STEP Day HH:MM:SS KINETIC_ENRG POTEN_ENRG TOTAL_ENRG NET_VOLUME
C => (i,j,k) Cu Cv Cw Max Speed

0 0 00:00:00 0.000000E+00 2.443656E+03 2.443656E+03 6.062203E+10
(000,000,00) 0.000000E+00 0.000000E+00 0.000000E+00 0.000000E+00
DEF_HIS - creating history file, Grid 01:test_his.nc
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000001
DEF_AVG - creating average file, Grid 01: test_avg.nc
1 0 00:00:00 7.683448E-35 2.443656E+03 2.443656E+03 6.062203E+10
(055,279,01) 2.956034E-20 2.295978E-20 0.000000E+00 7.308621E-17
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000002
2 0 00:00:00 2.998380E-34 2.443656E+03 2.443656E+03 6.062203E+10
(059,232,25) 7.320610E-23 2.469957E-22 1.210115E-16 1.455857E-16
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000003
3 0 00:00:00 6.393114E-34 2.443656E+03 2.443656E+03 6.062203E+10
(059,232,25) 2.960169E-22 8.339658E-22 2.396351E-16 2.081325E-16
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000004
4 0 00:00:00 1.057535E-33 2.443656E+03 2.443656E+03 6.062203E+10
(060,215,25) 1.558190E-21 1.742108E-21 3.316582E-16 2.777126E-16
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000005
5 0 00:00:00 1.515434E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,220,25) 2.512753E-21 6.402644E-21 3.882275E-16 3.455490E-16
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000006
6 0 00:00:00 2.002507E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,220,25) 4.040876E-21 1.064636E-20 4.743808E-16 4.141044E-16
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000007
7 0 00:00:00 2.523286E-33 2.443656E+03 2.443656E+03 6.062203E+10
(072,210,25) 1.442238E-21 8.720640E-21 4.914241E-16 4.084652E-16
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000008
8 0 00:00:00 3.100752E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,227,25) 1.502957E-20 4.260061E-21 6.723791E-16 4.857828E-16
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000009
9 0 00:00:00 3.849988E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,227,25) 2.218424E-20 6.157553E-21 8.303542E-16 5.358812E-16
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000010
10 0 00:00:00 4.868136E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,227,25) 2.917001E-20 9.172513E-21 9.764363E-16 6.139129E-16
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000011
11 0 00:00:01 6.268655E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,227,25) 3.607085E-20 1.302249E-20 1.115330E-15 7.440506E-16
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000012
12 0 00:00:01 8.369650E-33 2.443656E+03 2.443656E+03 6.062203E+10
(059,227,25) 5.194520E-20 6.662200E-21 1.247595E-15 9.247428E-16
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000013
13 0 00:00:01 1.112631E-32 2.443656E+03 2.443656E+03 6.062203E+10
(057,260,25) 3.560716E-20 3.367417E-20 1.589914E-15 1.169120E-15
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000014
14 0 00:00:01 1.471494E-32 2.443656E+03 2.443656E+03 6.062203E+10
(057,260,25) 4.327564E-20 4.321404E-20 2.090863E-15 1.245759E-15
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000015
15 0 00:00:01 1.905260E-32 2.443656E+03 2.443656E+03 6.062203E+10
(057,260,25) 4.953927E-20 3.361146E-20 2.234649E-15 1.357160E-15
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000016
16 0 00:00:01 2.378065E-32 2.443656E+03 2.443656E+03 6.062203E+10
(057,260,25) 6.109147E-20 3.534715E-20 2.233878E-15 1.596360E-15
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000017
17 0 00:00:01 2.913721E-32 2.443656E+03 2.443656E+03 6.062203E+10
(057,260,25) 7.089579E-20 3.153928E-20 2.478895E-15 1.578471E-15
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000018
18 0 00:00:01 3.478887E-32 2.443656E+03 2.443656E+03 6.062203E+10
(077,212,25) 4.238316E-20 4.229389E-20 2.702496E-15 1.744218E-15
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000019
19 0 00:00:01 4.082675E-32 2.443656E+03 2.443656E+03 6.062203E+10
(077,212,25) 4.635683E-20 6.137634E-20 3.008248E-15 1.876896E-15
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000020
20 0 00:00:02 4.705051E-32 2.443656E+03 2.443656E+03 6.062203E+10
(077,212,25) 4.555486E-20 8.601696E-20 3.192550E-15 2.056666E-15
WRT_HIS - wrote history fields (Index=1,1) into time record = 0000021
21 0 00:00:02 5.367365E-32 2.443656E+03 2.443656E+03 6.062203E+10
(077,212,25) 4.904596E-20 1.054262E-19 3.160040E-15 2.130441E-15
WRT_HIS - wrote history fields (Index=2,2) into time record = 0000022
Last edited by zzyfathead on Mon Jan 13, 2020 2:36 am, edited 1 time in total.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#8 Unread post by kate »

GET_2DFLD - surface u-momentum stress, t = 0 02:24:00
(Rec=0000002, Index=2, File: palu_stress.nc)
(Tmin= 0.0000 Tmax= 3001.0000)
(Min = 0.00000000E+00 Max = 0.00000000E+00)
It is reading the second record here. What are the units on time in the stress file? What units do you think it should be? Perhaps ROMS only reads it as days? One would have to check the code to be sure.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#9 Unread post by zzyfathead »

Thanks, I read the code, it only reads 'days' and 'seconds', it cannot read 's'.

And I also find another problem: the smallest dt of uvstress ROMS can recoganize is 1s. 0.1s is not permitted.

But I need to input uvstress with a dt of 0.1, I am trying to find the related code.

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#10 Unread post by kate »

It sounded like you wanted a linear progression in time for your stress. If so, ROMS does a linear interpolation in time from one record to the next and could be doing that work for you. Or for a very simple pattern you can use the ana_xxx.h code which gets called every timestep.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#11 Unread post by zzyfathead »

kate wrote: Mon Jan 13, 2020 11:17 am It sounded like you wanted a linear progression in time for your stress. If so, ROMS does a linear interpolation in time from one record to the next and could be doing that work for you. Or for a very simple pattern you can use the ana_xxx.h code which gets called every timestep.
Oh, I want to input a set of scatter values, I don't want a linear progression in time (because the variables varies quickly with time). But it seems inputing by nc file does not support variables with a dt = 0.1s.

Thanks for your suggestion. I will try to use ana_smflux. But I find that the uvstress in ana_smflux.h only have 2 dimensions, how to show its relation with time? ROMS read this ana.h file each time step to get data, so uvstress does not need time dimension?
Attachments
ana.png
ana.png (11.77 KiB) Viewed 5908 times

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#12 Unread post by kate »

It is called every time step. Changes in time happen in your code.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#13 Unread post by zzyfathead »

kate wrote: Mon Jan 13, 2020 1:59 pm It is called every time step. Changes in time happen in your code.
Thanks, Sorry I have a quesiton and maybe it's stupid.

If i input a vector as sustr series, one element in the vector indicate one step's sustr, how does ROMS read it? It can read the first element in the first time step, the second element in the second time step......?

Which .F file can read ana.h file, maybe I can find the answer in that code?

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#14 Unread post by kate »

The answer might be in ROMS/Functionals//ana_smflux.h, which is the file with the analytic surface stresses for some of the standard test problems. Some of them have things which vary in time as examples. If you want to change things by the timestep number, that is iic in the code.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#15 Unread post by zzyfathead »

kate wrote: Tue Jan 14, 2020 7:36 pm The answer might be in ROMS/Functionals//ana_smflux.h, which is the file with the analytic surface stresses for some of the standard test problems. Some of them have things which vary in time as examples. If you want to change things by the timestep number, that is iic in the code.
Thanks a looot !!

I read the code and found that they use 'time' variable in functions.

I want to change things by timestep number, so I try to use iic(ng), I find .h file does not looks like C file, I use C language to read the sustr.txt file and fail to run?

Thanks again

User avatar
kate
Posts: 4091
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: some problems about bulk_fluxes

#16 Unread post by kate »

No, the .h files are included in the fortran files, compiled by the Fortran compiler. Linking to C code is a different beast. Not impossible, just different.

User avatar
zzyfathead
Posts: 22
Joined: Wed Sep 18, 2019 1:53 pm
Location: ANU

Re: some problems about bulk_fluxes

#17 Unread post by zzyfathead »

kate wrote: Wed Jan 15, 2020 5:01 pm No, the .h files are included in the fortran files, compiled by the Fortran compiler. Linking to C code is a different beast. Not impossible, just different.
Kate, thanks for your suggestion, I changed ana.h file successfully and I can run ROMSnow.

zzy

Post Reply