Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

Writing out vertical tracer flux at specific vertical level

sur23beeb

ST
Member
I have successfully added a new variable WTT_2 to the routine advection.f90 that is the vertical heat flux at a specific vertical level. The new variable is being written out in the output file with the proper dimensions (time, nlat, nlon). I thought I was writing out the flux at 40 m depth which is what I want but now feel this might not be the case and want to confirm before queuing up some long runs. The new lines I added are based on existing code for WT_TRACER, which I repeated for a new variable WT_TRACER_2, with the following section calculating the new variable:
Code:
      if (k==4)  then 
        do n=1,2
           if (tadvect_itype(n) == tadvect_centered) then
               WORK = dz2r(k)*WTK*(TRCR(:,:,k  ,n) + TRCR(:,:,k-1,n))
              call accumulate_tavg_field(WORK,tavg_WT_TRACER_2(n),bid,k)
           else
              call accumulate_tavg_field(FLUX_T(:,:,n),tavg_WT_TRACER_2(n),bid,k)
           endif
        end do
      endif
Because my runs are using the tadvect_centered setting, it looks like the flux is being calculated using TRCR fields at vertical levels k and k-1. The above section is activated when k=4. The vertical levels for TRCR are given by z_t = (5, 15, 25, ....) m. So the new variable is computed using TRCR fields at k=4 (z_t = 35 m) and k=3 (z_t = 30 m). That would mean the vertical location for my new variable as computed above is 30 m and not 40 m, am I correct?

Thanks for your help.
 

sur23beeb

ST
Member
I have successfully added a new variable WTT_2 to the routine advection.f90 that is the vertical heat flux at a specific vertical level. The new variable is being written out in the output file with the proper dimensions (time, nlat, nlon). I thought I was writing out the flux at 40 m depth which is what I want but now feel this might not be the case and want to confirm before queuing up some long runs. The new lines I added are based on existing code for WT_TRACER, which I repeated for a new variable WT_TRACER_2, with the following section calculating the new variable:
Code:
      if (k==4)  then
        do n=1,2
           if (tadvect_itype(n) == tadvect_centered) then
               WORK = dz2r(k)*WTK*(TRCR(:,:,k  ,n) + TRCR(:,:,k-1,n))
              call accumulate_tavg_field(WORK,tavg_WT_TRACER_2(n),bid,k)
           else
              call accumulate_tavg_field(FLUX_T(:,:,n),tavg_WT_TRACER_2(n),bid,k)
           endif
        end do
      endif
Because my runs are using the tadvect_centered setting, it looks like the flux is being calculated using TRCR fields at vertical levels k and k-1. The above section is activated when k=4. The vertical levels for TRCR are given by z_t = (5, 15, 25, ....) m. So the new variable is computed using TRCR fields at k=4 (z_t = 35 m) and k=3 (z_t = 30 m). That would mean the vertical location for my new variable as computed above is 30 m and not 40 m, am I correct?

Thanks for your help.
Just noticed a typo. The depth corresponding to k=3 is z_t = 25 m, not 30 m as stated in my original post.
 
Top