Skip to content

Commit

Permalink
add temporary comments for understanding
Browse files Browse the repository at this point in the history
  • Loading branch information
dcesari committed Feb 24, 2023
1 parent 4274cd9 commit 90c755d
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions volgrid6d/volgrid6d_alchimia_class.F03
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ subroutine make_vg6d(mayvfn,mybin,mybout,vg6din,vg6dout,allvarcomputed)
ntime=size(vg6din%time)
ntimerange=size(vg6din%timerange)

!we have to make a new volume with var required in input function plus var for output

!star with input variables
! we have to make a new volume with var required in input function plus var for output
! start with input variables
! deletenote: mybin() corresponds to vg6din%var()
! deletenote: after 2 following big loops it is not guaranteed that all elements of mybin are in newbout
newbout=cmiss

do i=1, size(mayvfn%fnds)
Expand Down Expand Up @@ -104,7 +105,6 @@ subroutine make_vg6d(mayvfn,mybin,mybout,vg6din,vg6dout,allvarcomputed)

! create output volume
call init(vg6dout, vg6din%griddim, vg6din%time_definition, categoryappend="generated by alchimia make")
!call volgrid6d_alloc(vg6dout, vg6din%griddim%dim, ntime, nlevel, ntimerange, nvar)
call volgrid6d_alloc(vg6dout, ntime=ntime, nlevel=nlevel, ntimerange=ntimerange, nvar=nvar)
call volgrid6d_alloc_vol(vg6dout,inivol=.true.,decode=.true.)

Expand All @@ -115,13 +115,17 @@ subroutine make_vg6d(mayvfn,mybin,mybout,vg6din,vg6dout,allvarcomputed)
! now I copy the needed input variables from input volume to output
DO ivar=1, nvar
ivarin = index_c(mybin,newbout(ivar))
ivarout = ivar
ivarout = ivar ! why do i need to use ivarout as alias for ivar?

if (ivarin == 0) then
call l4f_log(L4F_debug,"variable to compute in make_vg6d: "//newbout(ivar))
cycle
end if
IF (ivarin == 0) THEN
#ifdef DEBUG
CALL l4f_log(L4F_debug,"variable to compute in make_vg6d: "//newbout(ivar))
#endif
CYCLE
ENDIF

! delete note: varvg6d (future vg6dout%var? is filled in sparse mode? probably not because newbout
! contains at the beginning only elements that are also in mybin
varvg6d(ivarout)=vg6din%var(ivarin)
call init(gaid_template)

Expand All @@ -148,6 +152,7 @@ subroutine make_vg6d(mayvfn,mybin,mybout,vg6din,vg6dout,allvarcomputed)
ENDDO
ENDDO

! delete note: am i sure that up to now i have filled varvg6d exactly up to nvarin?
CALL vargrib2varbufr(varvg6d(:nvarin), varv7d(:nvarin), c_funcgb)

do ivar = nvarin+1, nvar
Expand Down

0 comments on commit 90c755d

Please sign in to comment.