[MITgcm-devel] code changes
Holly Dail
hdail at MIT.EDU
Thu Mar 10 12:22:29 EST 2011
>> Hate to open other cans of worms, but there is some inconsistency in the code re. the ordering of obcs control fields. I believe the code pieces I'm using assume the 3rd field is vvel and 4th field is uvel (i.e. they are packed T/S/V/U -- see for example ctrl_getobcss.F where OBSu is modified when iobcs is 4), while code like cost_obcsvol.F assumes they are packed T/S/U/V (which is more logical, but this code is never called from any other S/R). I can't figure out right now which order they are packed into the control files. I'm mostly concerned as to whether its all consistent, rather than whether its illogical.
> I can only recommend to avoid code within #ifdef ALLOW_CTRL_OBCS_BALANCE. The code does not look right to me. I think Jake tried to balance both normal and tangential xx_velocities (why?) and might have mixed up things? Plus, there are definitely hfac's missing in this computation, so leave it alone. The ordering is T/S/U/V for the obcs and this is also true for the ctrl-fields.
> For balanced flow even with optimized boundary flow you can (probably) use the "forward" flags OBCSuseBalance with all the new features checked in by Jean-Michel. I am currently using an older hacked version which does effectively what Jean-Michel implemented more generally, and this gives fine results (in terms of balancing).
I'm attaching the relevant bits from ctrl_getobcss.F in which I believe the ordering is T/S/V/U:
else if (iobcs .EQ. 4) then
OBSu(i,k,bi,bj) = OBSu (i,k,bi,bj)
& + obcssfac *xx_obcss0(i,k,bi,bj,iobcs)
& + (1. _d 0 - obcssfac)*xx_obcss1(i,k,bi,bj,iobcs)
OBSu(i,k,bi,bj) = OBSu(i,k,bi,bj)
& *maskW(i,j,k,bi,bj)
else if (iobcs .EQ. 3) then
OBSv(i,k,bi,bj) = OBSv (i,k,bi,bj)
& + obcssfac *xx_obcss0(i,k,bi,bj,iobcs)
& + (1. _d 0 - obcssfac)*xx_obcss1(i,k,bi,bj,iobcs)
OBSv(i,k,bi,bj) = OBSv(i,k,bi,bj)
& *maskS(i,j+jp1,k,bi,bj)
More information about the MITgcm-devel
mailing list