Calculates the half squared strain rate on l_w-points which is used in determining the Richardson number. CX=1./DX, CY=1./DY, RDZ(K)=1./DZ(K), RDZN(K) =1./DZN(K) _SSQ= 0.5*^^DU_I/DX_J+DU_J/DX_I^^**2 _SSQIJ= (DU_I/DX_J+DU_J/DX_I)**2 _Hence SSQ= SUM(I,J) {0.5*(SSQIJ)}.
411 type(model_state_type),
target,
intent(inout) :: current_state
412 type(prognostic_field_type),
intent(inout) :: u, v, w
418 do k=2,current_state%local_grid%size(
z_index)-1
420 ssq11=current_state%global_grid%configuration%horizontal%cx2*(&
421 (u%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
422 u%data(k+1, current_state%column_local_y, current_state%column_local_x-1))**2+&
423 (u%data(k, current_state%column_local_y, current_state%column_local_x)-&
424 u%data(k, current_state%column_local_y, current_state%column_local_x-1))**2)
426 ssq11=0.0_default_precision
429 ssq22=current_state%global_grid%configuration%horizontal%cy2*(&
430 (v%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
431 v%data(k+1, current_state%column_local_y-1, current_state%column_local_x))**2+&
432 (v%data(k, current_state%column_local_y, current_state%column_local_x)-&
433 v%data(k, current_state%column_local_y-1, current_state%column_local_x))**2)
435 ssq22=0.0_default_precision
438 ssq33=((w%data(k, current_state%column_local_y, current_state%column_local_x)-&
439 w%data(k-1, current_state%column_local_y, current_state%column_local_x))*&
440 current_state%global_grid%configuration%vertical%rdz(k))**2 +&
441 ((w%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
442 w%data(k, current_state%column_local_y, current_state%column_local_x))*&
443 current_state%global_grid%configuration%vertical%rdz(k+1))**2
445 ssq33=0.0_default_precision
447 #if defined(U_ACTIVE) && defined(W_ACTIVE)
449 ssq13=(((u%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
450 u%data(k, current_state%column_local_y, current_state%column_local_x))*&
451 current_state%global_grid%configuration%vertical%rdzn(k+1)+&
452 (w%data(k, current_state%column_local_y, current_state%column_local_x+1)-&
453 w%data(k, current_state%column_local_y, current_state%column_local_x))*&
454 current_state%global_grid%configuration%horizontal%cx)**2+&
455 ((u%data(k+1, current_state%column_local_y, current_state%column_local_x-1)-&
456 u%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
457 current_state%global_grid%configuration%vertical%rdzn(k+1)+&
458 (w%data(k, current_state%column_local_y, current_state%column_local_x)-&
459 w%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
460 current_state%global_grid%configuration%horizontal%cx)**2)*0.5_default_precision
461 #elif defined(U_ACTIVE) && !defined(W_ACTIVE)
462 ssq13=(((u%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
463 u%data(k, current_state%column_local_y, current_state%column_local_x))*&
464 current_state%global_grid%configuration%vertical%rdzn(k+1))**2+&
465 ((u%data(k+1, current_state%column_local_y, current_state%column_local_x-1)-&
466 u%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
467 current_state%global_grid%configuration%vertical%rdzn(k+1))**2)*0.5_default_precision
468 #elif !defined(U_ACTIVE) && defined(W_ACTIVE)
469 ssq13=(((w%data(k, current_state%column_local_y, current_state%column_local_x+1)-&
470 w%data(k, current_state%column_local_y, current_state%column_local_x))*&
471 current_state%global_grid%configuration%horizontal%cx)**2+&
472 ((w%data(k, current_state%column_local_y, current_state%column_local_x)-&
473 w%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
474 current_state%global_grid%configuration%horizontal%cx)**2)*0.5_default_precision
476 ssq13=0.0_default_precision
478 #if defined(W_ACTIVE) && defined(V_ACTIVE)
480 ssq23=(((w%data(k, current_state%column_local_y, current_state%column_local_x)-&
481 w%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
482 current_state%global_grid%configuration%horizontal%cy+&
483 (v%data(k+1, current_state%column_local_y-1, current_state%column_local_x)-&
484 v%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
485 current_state%global_grid%configuration%vertical%rdzn(k+1))**2+&
486 ((w%data(k, current_state%column_local_y+1, current_state%column_local_x)-&
487 w%data(k, current_state%column_local_y, current_state%column_local_x))*&
488 current_state%global_grid%configuration%horizontal%cy+&
489 (v%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
490 v%data(k, current_state%column_local_y, current_state%column_local_x))*&
491 current_state%global_grid%configuration%vertical%rdzn(k+1))**2)*0.5_default_precision
492 #elif defined(W_ACTIVE) && !defined(V_ACTIVE)
493 ssq23=(((w%data(k, current_state%column_local_y, current_state%column_local_x)-&
494 w%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
495 current_state%global_grid%configuration%horizontal%cy)**2+&
496 ((w%data(k, current_state%column_local_y+1, current_state%column_local_x)-&
497 w%data(k, current_state%column_local_y, current_state%column_local_x))*&
498 current_state%global_grid%configuration%horizontal%cy)**2)*0.5_default_precision
499 #elif !defined(W_ACTIVE) && defined(V_ACTIVE)
500 ssq23=(((v%data(k+1, current_state%column_local_y-1, current_state%column_local_x)-&
501 v%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
502 current_state%global_grid%configuration%vertical%rdzn(k+1))**2+&
503 ((v%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
504 v%data(k, current_state%column_local_y, current_state%column_local_x))*&
505 current_state%global_grid%configuration%vertical%rdzn(k+1))**2)*0.5_default_precision
507 ssq23=0.0_default_precision
510 #if defined(U_ACTIVE) && defined(V_ACTIVE)
512 ssq12=(((((u%data(k, current_state%column_local_y, current_state%column_local_x-1)-&
513 u%data(k, current_state%column_local_y-1, current_state%column_local_x-1))*&
514 current_state%global_grid%configuration%horizontal%cy+&
515 (v%data(k, current_state%column_local_y-1, current_state%column_local_x)-&
516 v%data(k, current_state%column_local_y-1, current_state%column_local_x-1))*&
517 current_state%global_grid%configuration%horizontal%cx)**2 +&
518 ((u%data(k, current_state%column_local_y+1, current_state%column_local_x-1)-&
519 u%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
520 current_state%global_grid%configuration%horizontal%cy+&
521 (v%data(k, current_state%column_local_y, current_state%column_local_x)-&
522 v%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
523 current_state%global_grid%configuration%horizontal%cx)**2) +(&
524 ((u%data(k, current_state%column_local_y, current_state%column_local_x)-&
525 u%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
526 current_state%global_grid%configuration%horizontal%cy+&
527 (v%data(k, current_state%column_local_y-1, current_state%column_local_x+1)-&
528 v%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
529 current_state%global_grid%configuration%horizontal%cx)**2 +&
530 ((u%data(k, current_state%column_local_y+1, current_state%column_local_x)-&
531 u%data(k, current_state%column_local_y, current_state%column_local_x))*&
532 current_state%global_grid%configuration%horizontal%cy+&
533 (v%data(k, current_state%column_local_y, current_state%column_local_x+1)-&
534 v%data(k, current_state%column_local_y, current_state%column_local_x))*&
535 current_state%global_grid%configuration%horizontal%cx)**2))+((&
536 ((u%data(k+1, current_state%column_local_y, current_state%column_local_x-1)-&
537 u%data(k+1, current_state%column_local_y-1, current_state%column_local_x-1))*&
538 current_state%global_grid%configuration%horizontal%cy+&
539 (v%data(k+1, current_state%column_local_y-1, current_state%column_local_x)-&
540 v%data(k+1, current_state%column_local_y-1, current_state%column_local_x-1))*&
541 current_state%global_grid%configuration%horizontal%cx)**2+&
542 ((u%data(k+1, current_state%column_local_y+1, current_state%column_local_x-1)-&
543 u%data(k+1, current_state%column_local_y, current_state%column_local_x-1))*&
544 current_state%global_grid%configuration%horizontal%cy+&
545 (v%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
546 v%data(k+1, current_state%column_local_y, current_state%column_local_x-1))*&
547 current_state%global_grid%configuration%horizontal%cx)**2)+(&
548 ((u%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
549 u%data(k+1, current_state%column_local_y-1, current_state%column_local_x))*&
550 current_state%global_grid%configuration%horizontal%cy+&
551 (v%data(k+1, current_state%column_local_y-1, current_state%column_local_x+1)-&
552 v%data(k+1, current_state%column_local_y-1, current_state%column_local_x))*&
553 current_state%global_grid%configuration%horizontal%cx)**2+&
554 ((u%data(k+1, current_state%column_local_y+1, current_state%column_local_x)-&
555 u%data(k+1, current_state%column_local_y, current_state%column_local_x))*&
556 current_state%global_grid%configuration%horizontal%cy+&
557 (v%data(k+1, current_state%column_local_y, current_state%column_local_x+1)-&
558 v%data(k+1, current_state%column_local_y, current_state%column_local_x))*&
559 current_state%global_grid%configuration%horizontal%cx)**2)))*0.125_default_precision
561 #elif defined(U_ACTIVE) && !defined(V_ACTIVE)
563 ssq12=(((((u%data(k, current_state%column_local_y, current_state%column_local_x-1)-&
564 u%data(k, current_state%column_local_y-1, current_state%column_local_x-1))*&
565 current_state%global_grid%configuration%horizontal%cy)**2 +&
566 ((u%data(k, current_state%column_local_y+1, current_state%column_local_x-1)-&
567 u%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
568 current_state%global_grid%configuration%horizontal%cy)**2) +(&
569 ((u%data(k, current_state%column_local_y, current_state%column_local_x)-&
570 u%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
571 current_state%global_grid%configuration%horizontal%cy)**2 +&
572 ((u%data(k, current_state%column_local_y+1, current_state%column_local_x)-&
573 u%data(k, current_state%column_local_y, current_state%column_local_x))*&
574 current_state%global_grid%configuration%horizontal%cy)**2))+((&
575 ((u%data(k+1, current_state%column_local_y, current_state%column_local_x-1)-&
576 u%data(k+1, current_state%column_local_y-1, current_state%column_local_x-1))*&
577 current_state%global_grid%configuration%horizontal%cy)**2+&
578 ((u%data(k+1, current_state%column_local_y+1, current_state%column_local_x-1)-&
579 u%data(k+1, current_state%column_local_y, current_state%column_local_x-1))*&
580 current_state%global_grid%configuration%horizontal%cy)**2)+(&
581 ((u%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
582 u%data(k+1, current_state%column_local_y-1, current_state%column_local_x))*&
583 current_state%global_grid%configuration%horizontal%cy)**2+&
584 ((u%data(k+1, current_state%column_local_y+1, current_state%column_local_x)-&
585 u%data(k+1, current_state%column_local_y, current_state%column_local_x))*&
586 current_state%global_grid%configuration%horizontal%cy)**2)))*0.125_default_precision
588 #elif !defined(U_ACTIVE) && defined(V_ACTIVE)
590 ssq12=(((((v%data(k, current_state%column_local_y-1, current_state%column_local_x)-&
591 v%data(k, current_state%column_local_y-1, current_state%column_local_x-1))*&
592 current_state%global_grid%configuration%horizontal%cx)**2 +&
593 ((v%data(k, current_state%column_local_y, current_state%column_local_x)-&
594 v%data(k, current_state%column_local_y, current_state%column_local_x-1))*&
595 current_state%global_grid%configuration%horizontal%cx)**2) +&
596 (((v%data(k, current_state%column_local_y-1, current_state%column_local_x+1)-&
597 v%data(k, current_state%column_local_y-1, current_state%column_local_x))*&
598 current_state%global_grid%configuration%horizontal%cx)**2 +&
599 ((v%data(k, current_state%column_local_y, current_state%column_local_x+1)-&
600 v%data(k, current_state%column_local_y, current_state%column_local_x))*&
601 current_state%global_grid%configuration%horizontal%cx)**2))+((&
602 ((v%data(k+1, current_state%column_local_y-1, current_state%column_local_x)-&
603 v%data(k+1, current_state%column_local_y-1, current_state%column_local_x-1))*&
604 current_state%global_grid%configuration%horizontal%cx)**2+&
605 ((v%data(k+1, current_state%column_local_y, current_state%column_local_x)-&
606 v%data(k+1, current_state%column_local_y, current_state%column_local_x-1))*&
607 current_state%global_grid%configuration%horizontal%cx)**2)+(&
608 ((v%data(k+1, current_state%column_local_y-1, current_state%column_local_x+1)-&
609 v%data(k+1, current_state%column_local_y-1, current_state%column_local_x))*&
610 current_state%global_grid%configuration%horizontal%cx)**2+&
611 ((v%data(k+1, current_state%column_local_y, current_state%column_local_x+1)-&
612 v%data(k+1, current_state%column_local_y, current_state%column_local_x))*&
613 current_state%global_grid%configuration%horizontal%cx)**2)))*0.125_default_precision
615 ssq12=0.0_default_precision
617 calculate_half_squared_strain_rate(k)=ssq11+ssq22+ssq33+ssq13+ssq23+ssq12+smallp