[MITgcm-devel] changing cg2d
Martin Losch
Martin.Losch at awi.de
Fri Dec 1 02:38:02 EST 2006
Hi Jean-Michel, the cg2d_nsa (not self adjoint) is only for bottom
topography as a control parameter. It's based on a version of cg2d
around ckpt40 or so. So I am not surprised that modifications from
3yrs ago did make it into this version. Likewise the
ALLOW_CONST_RHSMAX is necessary as long as there isn't a working
adjoint to global_max (which I have been to stupid to generate so
far). Maybe we can merge the new features of cg2d into cg2d_nsa in
the future?
M.
On 1 Dec 2006, at 01:16, Jean-Michel Campin wrote:
> Hi,
>
> I will make the changes in cg2d.F
>
> Patrick:
> We also have a 2nd version, cg2d_nsa.F, that I don't feel like
> changing:
> I noticed that when it was checked-in (~6.month ago), did not have
> the latest changes from cg2d.F (from about the last 3.yrs), and it
> will continue.
> Just one thing, when using cg2dTargetResWunit (instead of
> cg2dTargetResidual), the RHS is not normalised, which is pretty
> much what the "#ifdef ALLOW_CONST_RHSMAX" is doing.
>
> Jean-Michel
>
> On Wed, Nov 29, 2006 at 08:44:23PM -0500, Jean-Michel Campin wrote:
>> Hi Chris,
>>
>> I was wondering if pre-computing the diagnonal term of the
>> 2.D solver in ini_cg2d (like I did for cg3d.F, version 1.17 versus
>> 1.16)
>> could speed up the solver (or at least, not make it slower) ?
>>
>> Here it will be only one additional 2-D array (aC2d) to store,
>> will reduce the memory acces in cg2d (no acces to rA, recip_Bo)
>> and reduce the number of floating point operations
>> since lines 175 to 180:
>> & -aW2d(I ,J ,bi,bj)*cg2d_x(I ,J ,bi,bj)
>> & -aW2d(I+1,J ,bi,bj)*cg2d_x(I ,J ,bi,bj)
>> & -aS2d(I ,J ,bi,bj)*cg2d_x(I ,J ,bi,bj)
>> & -aS2d(I ,J+1,bi,bj)*cg2d_x(I ,J ,bi,bj)
>> & -freeSurfFac*_rA(i,j,bi,bj)*recip_Bo(i,j,bi,bj)*
>> & cg2d_x(I ,J ,bi,bj)/deltaTMom/deltaTfreesurf*cg2dNorm
>> will be replaced by just:
>> & +aC2d(I ,J ,bi,bj)*cg2d_x(I ,J ,bi,bj)
>>
>> and same thing for lines 302-307
>>
>> The reason I am asking this, is that for the deep atmosphere,
>> to make it "right" in p-coordinate with topography,
>> the area "rA" has to be scaled at the surface level kSurfC(i,j,bi,bj)
>> -> indirect indexing -> might not be efficient.
>> If we decide to change cg2d.F and store the diagnonal term,
>> now will be a good time.
>>
>> Jean-Michel
>>
>> _______________________________________________
>> MITgcm-devel mailing list
>> MITgcm-devel at mitgcm.org
>> http://mitgcm.org/mailman/listinfo/mitgcm-devel
> _______________________________________________
> MITgcm-devel mailing list
> MITgcm-devel at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-devel
More information about the MITgcm-devel
mailing list